-
-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Vote] FPM support #33
Comments
Hi there 👋 To be honest, I originally created this image for continuous integration tools so I never really needed FPM but I'm willing to consider using it as a new set of images. My primary goal for this image is to stay as small as possible whilst covering the 80% use cases of Laravel users. FPM being a pretty important part of PHP, I think you make a good point. Could I ask you why you need FPM in your case? Are you using this image in a production server? @fgilio Franco, do you have any strong opinion on this? |
Just recently added it to a server due to a request from a PHP dev for a Laravel setup, it's not serving a production site or service at present. Other PHP based containers I have been using are all this trafex/alpine-nginx-php7 image, which also bundled nginx as their webservers, which are used in combination with In future, I plan to migrate the reverse-proxy to Traefik, and not being too familiar with PHP environments myself(this is a non-profit community rather than commercial). I've only recently been aware that nginx can be separated out to it's own container while using the fpm related part of nginx config. When I set these PHP containers up for their community a couple years back, I recall FPM being important / helpful improvement, it has about 1,000 active users, not that big, but not too small either. Most guides for using nginx with PHP mention with FPM afaik, so it may have been related to that as well. Presently the container is setup like so with docker-compose(I know that artisan is not meant to be used for production, and will switch it when I've had time to figure out how): laravel:
image: lorisleiva/laravel-docker:7.3
container_name: test_laravel
restart: always
ports:
- 8000:8000
links:
- db
environment:
VIRTUAL_PORT: 8000
VIRTUAL_HOST: laravel.example.tld
LETSENCRYPT_HOST: laravel.example.tld
LETSENCRYPT_EMAIL: ${ADMIN_EMAIL}
volumes:
- ./websites/laravel/hello_world:/var/www/laravel
working_dir: /var/www/laravel/
command: php artisan serve --port=8000 --host=0.0.0.0 The host param for artisan needed to be The working_dir, was because of the default one has an "html" directory and I'm mounting the laravel project(I could have gone with anything else like
There doesn't appear to be any official Laravel images on DockerHub and yours seemed to be a reasonably popular and still maintained image, after evaluating several others out there I decided yours was most appropriate for getting something up and going with minimal fuss. Your CI with GitLab Pipelines article also helped influence the choice as I'd like to go over that to get some automated deployments going. Presently any docker related changes are manually managed on the server with |
Hmmm I don't really have a lot of experience in this front. One thing that comes to mind if that using an FPM enabled version of the PHP image would be all that's required. |
I was facing the same limitation with Loris' docker image so I created another docker image which adds apache and php-fpm. if interested you can check it out here https://github.com/8ctopus/apache-php-fpm-alpine. |
can i use this image for production on AWS with |
Is there a reason for opting for
php:alpine
overphp:fpm-alpine
or not offering the fpm variant as well?It doesn't seem straight-forward to extend this image to add that fpm support looking at the Dockerfile for fpm variant(there's additional args run from an env var during the build).
Forking this repo just to replace the base image with the variant should work, but that doesn't seem like the right way to go about it.
The text was updated successfully, but these errors were encountered: