feat: update Docker configuration to manage public storage and optimize entrypoint script
This commit is contained in:
@@ -29,6 +29,9 @@ database/database.sqlite
|
|||||||
public/build
|
public/build
|
||||||
public/hot
|
public/hot
|
||||||
|
|
||||||
|
# ── Local storage symlink (recreated by entrypoint.sh) ──
|
||||||
|
public/storage
|
||||||
|
|
||||||
# ── Tests / dev tooling ──────────────────────
|
# ── Tests / dev tooling ──────────────────────
|
||||||
tests
|
tests
|
||||||
phpunit.xml
|
phpunit.xml
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ RUN chmod +x /entrypoint.sh
|
|||||||
|
|
||||||
# ── File system ──────────────────────────────
|
# ── File system ──────────────────────────────
|
||||||
RUN mkdir -p \
|
RUN mkdir -p \
|
||||||
|
storage/app/public \
|
||||||
storage/app/private/talent-assets \
|
storage/app/private/talent-assets \
|
||||||
storage/logs \
|
storage/logs \
|
||||||
storage/framework/cache \
|
storage/framework/cache \
|
||||||
|
|||||||
@@ -41,15 +41,19 @@ chmod -R 775 \
|
|||||||
bootstrap/cache \
|
bootstrap/cache \
|
||||||
database
|
database
|
||||||
|
|
||||||
# ── 5. Run migrations ────────────────────────
|
# ── 5. Discover packages (composer --no-scripts skips this) ──
|
||||||
|
echo "[packages] Discovering service providers…"
|
||||||
|
php artisan package:discover --ansi 2>/dev/null || true
|
||||||
|
|
||||||
|
# ── 6. Run migrations ─────────────────────────
|
||||||
echo "[migrate] Running database migrations…"
|
echo "[migrate] Running database migrations…"
|
||||||
php artisan migrate --force --no-interaction
|
php artisan migrate --force --no-interaction
|
||||||
|
|
||||||
# ── 5b. Create public storage symlink ────────
|
# ── 7. Create public storage symlink ──────────
|
||||||
echo "[storage] Creating public storage symlink…"
|
echo "[storage] Creating public storage symlink…"
|
||||||
php artisan storage:link --quiet 2>/dev/null || true
|
php artisan storage:link --quiet 2>/dev/null || true
|
||||||
|
|
||||||
# ── 6. Cache config / routes / views ────────
|
# ── 8. Cache config / routes / views ─────────
|
||||||
echo "[optimize] Caching configuration…"
|
echo "[optimize] Caching configuration…"
|
||||||
php artisan config:cache --quiet
|
php artisan config:cache --quiet
|
||||||
php artisan route:cache --quiet
|
php artisan route:cache --quiet
|
||||||
@@ -59,5 +63,5 @@ echo "────────────────────────
|
|||||||
echo " All checks passed. Starting services…"
|
echo " All checks passed. Starting services…"
|
||||||
echo "──────────────────────────────────────────"
|
echo "──────────────────────────────────────────"
|
||||||
|
|
||||||
# ── 7. Hand off to Supervisor ────────────────
|
# ── 9. Hand off to Supervisor ────────────────
|
||||||
exec supervisord -c /etc/supervisord.conf
|
exec supervisord -c /etc/supervisord.conf
|
||||||
|
|||||||
@@ -14,18 +14,7 @@ serverurl=unix:///run/supervisor.sock
|
|||||||
[rpcinterface:supervisor]
|
[rpcinterface:supervisor]
|
||||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||||
|
|
||||||
; ── Nginx ─────────────────────────────────────────────────────────────────
|
; ── PHP-FPM ───────────────────────────────────────────────────────────────────
|
||||||
[program:nginx]
|
|
||||||
command=nginx -g "daemon off;"
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
priority=10
|
|
||||||
stdout_logfile=/dev/stdout
|
|
||||||
stdout_logfile_maxbytes=0
|
|
||||||
stderr_logfile=/dev/stderr
|
|
||||||
stderr_logfile_maxbytes=0
|
|
||||||
|
|
||||||
; ── PHP-FPM ───────────────────────────────────────────────────────────────
|
|
||||||
[program:php-fpm]
|
[program:php-fpm]
|
||||||
command=php-fpm --nodaemonize
|
command=php-fpm --nodaemonize
|
||||||
autostart=true
|
autostart=true
|
||||||
@@ -36,12 +25,20 @@ stdout_logfile_maxbytes=0
|
|||||||
stderr_logfile=/dev/stderr
|
stderr_logfile=/dev/stderr
|
||||||
stderr_logfile_maxbytes=0
|
stderr_logfile_maxbytes=0
|
||||||
|
|
||||||
; ── Laravel Queue Worker ──────────────────────────────────────────────────
|
; ── Nginx ─────────────────────────────────────────────────────────────────────
|
||||||
|
[program:nginx]
|
||||||
|
command=nginx -g "daemon off;"
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
priority=10
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
|
||||||
|
; ── Laravel Queue Worker ──────────────────────────────────────────────────────
|
||||||
[program:queue]
|
[program:queue]
|
||||||
command=php /var/www/html/artisan queue:work --sleep=3 --tries=3 --max-time=3600 --queue=default
|
command=php /var/www/html/artisan queue:work --sleep=3 --tries=3 --max-time=3600 --queue=default
|
||||||
|
|
||||||
|
|
||||||
queue=default
|
|
||||||
directory=/var/www/html
|
directory=/var/www/html
|
||||||
user=www-data
|
user=www-data
|
||||||
autostart=true
|
autostart=true
|
||||||
|
|||||||
Reference in New Issue
Block a user