Docker image for a Laravel app+workers and nginx in supervisord
564
This image is a preparation to run Laravel workers and also an Laravel application. The application runs in PHP 8.0 with FastCGI in Alpine linux and MySQL drivers are prepared.
The configuration is generic and for one application, but should work with most apps. If not, copy your own configuration in your build or send me a pull request or message with your wish.
Note: The Laravel worker has its queue locally. This means:
FROM bausparkadse/laravel-nginx-supervisor:<version>
COPY . .
RUN composer install && chown -R www-data:www-data .
├── app
├── artisan
├── bootstrap
├── composer.json
├── composer.lock
├── config
├── database
├── Dockerfile <- This is the new Dockerfile.
├── phpunit.xml
├── public
│ ├── favicon.ico
│ ├── index.php
│ ├── robots.txt
│ ├── vendor
│ └── web.config
├── README.md
├── resources
├── routes
├── server.php
├── storage
└── tests
docker build -t your-project-image .
docker run --name your-project-container --rm --network="host" your-project-image
docker exec your-project-container php artisan migrate
Migrations are not ran automatically, because you shouldn't do it in Laravael production mode. So it must be done manually within the Docker container.
Content type
Image
Digest
Size
50.2 MB
Last updated
over 5 years ago
docker pull bausparkadse/laravel-nginx-supervisor:5