Introduces a self-contained Docker build under docker/ that boots the
full Laravel + Vite + Reverb + Horizon + scheduler stack inside a
single container.
The Dockerfile exposes two targets sharing a common system-base layer
(PHP 8.4-FPM Alpine + Postgres/Redis/intl/sockets/redis extensions):
- dev: bind-mount source at runtime, runs Vite via supervisord, hot
reloads PHP via opcache.validate_timestamps=1, UID/GID build args
align container writes with the host user.
- production: ships the prebuilt application — composer --no-dev,
npm run build + build:ssr, wayfinder TS pre-generated, OpCache
hardened, fixed UID 1000.
Sidecar configs (nginx, php.{dev,prod}.ini, supervisord.{dev,prod}.conf,
entrypoint, postgres-init for the test DB) live next to the Dockerfile
so the build context is self-describing. The entrypoint is idempotent
and handles APP_KEY generation, migrations, storage:link, Passport
keys, Wayfinder regen, and dependency reinstall on every boot.
69 lines
1.4 KiB
Text
69 lines
1.4 KiB
Text
[supervisord]
|
|
nodaemon=true
|
|
user=root
|
|
logfile=/dev/null
|
|
logfile_maxbytes=0
|
|
pidfile=/run/supervisord.pid
|
|
|
|
[program:php-fpm]
|
|
command=php-fpm -F
|
|
autostart=true
|
|
autorestart=true
|
|
priority=10
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
|
|
[program:nginx]
|
|
command=nginx -g 'daemon off;'
|
|
autostart=true
|
|
autorestart=true
|
|
priority=20
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
|
|
[program:reverb]
|
|
command=php /var/www/html/artisan reverb:start --host=0.0.0.0 --port=8080
|
|
autostart=true
|
|
autorestart=true
|
|
priority=30
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
|
|
[program:horizon]
|
|
command=php /var/www/html/artisan horizon
|
|
autostart=true
|
|
autorestart=true
|
|
priority=30
|
|
stopwaitsecs=10
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
|
|
[program:scheduler]
|
|
command=php /var/www/html/artisan schedule:work
|
|
autostart=true
|
|
autorestart=true
|
|
priority=40
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
|
|
[program:vite]
|
|
command=/bin/sh -c "exec /usr/bin/npm run dev -- --host 0.0.0.0"
|
|
directory=/var/www/html
|
|
autostart=true
|
|
autorestart=true
|
|
startsecs=10
|
|
priority=50
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|