Files
sag24-website/docker-compose.yml
striker b8668f2c6c 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).
2026-05-06 22:22:34 +03:00

34 lines
1.1 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
sag24-ru:
build:
context: .
dockerfile: Dockerfile
image: sag24-ru:latest
container_name: sag24-ru
restart: unless-stopped
ports:
- "127.0.0.1:4070:8080"
volumes:
# Секреты для контактной формы — вне образа, монтируется с хоста.
# На web путь: /opt/docker/sites/sag24-ru/secrets/contact-config.php
# contact.php ожидает файл по пути dirname(__DIR__, 2) == /var/www/sag24.ru
- ./secrets/contact-config.php:/var/www/sag24.ru/contact-config.php:ro
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/ru/"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
# Деплой на web (45.10.53.206):
# - /opt/docker/sites/sag24-ru/ ← git clone сюда
# ├── docker-compose.yml, Dockerfile, docker/, src/, ... (репо целиком)
# └── secrets/
# └── contact-config.php (вручную, не в git, .gitignored)
#
# Команды:
# cd /opt/docker/sites/sag24-ru
# git pull
# docker compose build
# docker compose up -d