example docker-compose.yml
version: "3.8"
services:
nginx:
image: nginx:stable-alpine
container_name: nginx
restart: always
ports:
- 8891:80
volumes:
- ./src:/app
- ./Dockerfiles/nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- db
- php
networks:
- laravel
php:
image: netsas/laravel-php8.1:latest
container_name: php
restart: always
volumes:
- ./src:/app
- ./Dockerfiles/php/php.ini:/usr/local/etc/php/php.ini
- ./Dockerfiles/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf
networks:
- laravel
networks:
laravel:
Example supervisord.conf
[supervisord]
nodaemon=true
loglevel = info
logfile=/var/log/supervisord.log
pidfile=/var/run/supervisord.pid
[program:php-fpm]
priority=5
command=php-fpm
numprocs=1
autostart=true
autorestart=true
[program:queue-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /app/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=root
numprocs=8
startsecs = 0
redirect_stderr=true
stdout_logfile=/app/storage/logs/queue.log
stopwaitsecs=3600
[program:laravel-octane]
process_name=%(program_name)s_%(process_num)02d
command=php /app/artisan octane:start --server=swoole --port=8000
autostart=true
autorestart=true
user=www-data
numprocs=1
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-octane.log
Content type
Image
Digest
sha256:3c025b630…
Size
204 MB
Last updated
8 months ago
docker pull netsas/laravel-php