Comments (5)
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?
from laravel-docker.
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.
Sorry I can't be of more help, I'll be following the discussion closely.
from laravel-docker.
Are you using this image in a production server?
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 nginx-proxy
.
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 0.0.0.0
(listen on all interfaces, not just loopback/localhost of the container), otherwise the docker host would get connection failures when making a request to the container despite the port mapping.
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 /srv/laravel
too I guess). I'm not sure if the "html" dir mattered or not when mounting a volume, but wanted to avoid dealing with any potential surprises later.
I originally created this image for continuous integration tools
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 docker-compose
commands, while project code is managed with git(and GitLab), it's sync'd to the project folders by the devs when they have production updates.
from laravel-docker.
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.
from laravel-docker.
can i use this image for production on AWS with artisan serve
?
from laravel-docker.
Related Issues (20)
- phpcs: command not found HOT 8
- bash: make: command not found HOT 2
- Error running composer install HOT 2
- phpcs: command not found HOT 1
- [Vote] Chromium for dusk tests HOT 1
- Missing extensions? HOT 1
- wkhtmltopdf issue for 7.4 HOT 6
- Latest version HOT 1
- Set php.ini parameters HOT 2
- Would it be possible to update to the latest PHPCS?
- Update to latest PHP8.1 HOT 3
- Error less: unrecognized option: X - PHP 7.4 HOT 2
- Disabling Xdebug HOT 1
- Rebuilding the images with latest PHP versions HOT 1
- build fails with node version issue HOT 1
- Imap Extension HOT 2
- Support for ARM64
- Missing git after commit "Install php extension with `docker-php-extension-installer` + get rid of already installed extension" HOT 7
- bash: git: command not found HOT 2
- phpunit: command not found HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-docker.