feat(docker): containerize sag24.ru — multi-stage Next.js build + nginx/php-fpm runtime

Single-container approach (nginx + php-fpm 8.3 + supervisord) to match web.hhivp.com
deployment paradigm (host nginx → docker по порту).

- Dockerfile: builder (node:22-alpine npm ci+next build) → runtime (php:8.3-fpm-alpine)
- docker/nginx.conf: serves static from /var/www/sag24.ru/public_html, fastcgi_pass на 127.0.0.1:9000
- docker/supervisord.conf: запускает php-fpm + nginx
- docker-compose.yml: для деплоя на web в /opt/docker/sites/sag24-ru/, mount contact-config.php read-only
- .dockerignore: исключает node_modules/.git/out из контекста

Container exposes :8080 (бесроутовый bind), маппится на host :4070 на web.
Watchtower label включён (auto-deploy на изменения образа в registry).
This commit is contained in:
2026-05-06 22:20:23 +03:00
parent ac0467290c
commit b2ca6d3ae7
5 changed files with 182 additions and 0 deletions

24
docker/supervisord.conf Normal file
View File

@@ -0,0 +1,24 @@
[supervisord]
nodaemon=true
logfile=/dev/stdout
logfile_maxbytes=0
pidfile=/run/supervisord.pid
user=root
[program:php-fpm]
command=/usr/local/sbin/php-fpm --nodaemonize
autorestart=true
priority=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
autorestart=true
priority=20
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0