brefphp / bref

Serverless PHP on AWS Lambda
https://bref.sh
MIT License
3.05k stars 364 forks source link

Troubleshooting Bref Docker Deployment with Octane Handler #1778

Closed pra-cloud closed 3 months ago

pra-cloud commented 3 months ago

I want to deploy my code on Docker over Lambda. I obtained this file from the documentation regarding PHP-FPM, but I want to use Octane as a handler. I have made some changes in my Dockerfile, replacing the public/index.php with the Octane handler. After deploying to Lambda, I am encountering this error:

  1. working dockerfile :-

FROM bref/php-81-fpm:2

COPY --from=bref/extra-redis-php-81:1 /opt /opt COPY --from=bref/extra-gmp-php-81:1 /opt /opt

COPY . /var/task

CMD ["public/index.php"]

  1. Not working Dockerfile:-

FROM bref/php-82-fpm

COPY --from=bref/extra-redis-php-81:1 /opt /opt

COPY --from=bref/extra-gmp-php-81:1 /opt /opt

COPY . /var/task

CMD ["Bref\LaravelBridge\Http\OctaneHandler"]

  1. Error:- In cloud watch respective lambda function i am getting this error.

INIT_REPORT Init Duration: 24.44 ms Phase: init Status: error Error Type: Runtime.ExitError

entrypoint requires the handler name to be the first argument