The app doesn’t need nginx just php-fpm.
Hi @tubiz! Of course! You can deploy your Laravel Zero app to Fly.io with a bit of configuration.
You just need to give a way for the Fly builder to build your app into an image. You can give it one of the three:
This looks promising for generating a Dockerfile: GitHub - owenvoke/laravel-zero-docker: A Laravel Zero command to generate a Dockerfile using Box
I have been able to create a Dockerfile for the deployment but deployment always fails due to healthchecks.
This is a command line app that doesn’t need a webserver (nginx) so no need for me to open port
Is there a way to make healthcheck passes for this use case?
Below is the content of my
app = "demo-cli-app" kill_signal = "SIGINT" kill_timeout = 5 processes =  [experimental] allowed_public_ports =  auto_rollback = true
FROM serversideup/php:8.1-cli RUN apt-get update && apt-get install -y \ git curl zip unzip ca-certificates vim htop cron \ php8.1-bcmath php8.1-xml php8.1-mbstring \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /var/www/html WORKDIR /var/www/html # copy application code, skipping files based on .dockerignore COPY . /var/www/html RUN composer install --optimize-autoloader --no-dev \ && mkdir -p storage/logs \ && chown -R webuser:webgroup /var/www/html \ && echo "MAILTO=\"\"\n* * * * * webuser /usr/bin/php /var/www/html/demo-app schedule:run" > /etc/cron.d/laravel \ && rm -rf /etc/cont-init.d/* \ && composer dump-autoload CMD [ "sleep", "100000" ]
Hi @tubiz awesome work on creating your Dockerfile!
In your app logs you might find an error like: “s6-overlay-suexec: fatal: can only run as pid 1”, if you do, this might be because you are using the base image
FROM serversideup/php:8.1-cli. The latest version might be using [s6-overlay] (edit:v3)(GitHub - just-containers/s6-overlay: s6 overlay for containers (includes execline, s6-linux-utils & a custom init)).
So to fix this, as announced here: 📣 [Laravel] Fix for error "Failed due to unhealthy allocations", kindly append a stable version to your base image that does not use the (edit:s6-v3)process:
Let me know how it goes!
Thank you very much. Deployment successful.
Awesome to hear!