Files
2026-etpgrf-site/docker-compose.yml

30 lines
1009 B
YAML
Raw 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.
version: '3.8'
services:
etpgrf-backend:
build: .
# Запускаем collectstatic перед стартом сервера, чтобы обновить статику в volume
command: sh -c "python etpgrf_site/manage.py collectstatic --noinput && gunicorn --bind 0.0.0.0:8000 --chdir /app/etpgrf_site etpgrf_site.wsgi"
volumes:
# Монтируем папку с базой данных
- ./data:/app/data
# Монтируем статику в именованный том, чтобы Nginx мог её читать
- static_volume:/app/public/static_collected
env_file:
- .env
etpgrf-nginx:
image: nginx:1.25-alpine
volumes:
- ./config/nginx/etpgrf--internal-nginx.conf:/etc/nginx/nginx.conf:ro
- static_volume:/app/public/static_collected
ports:
- "8000:80" # Слушаем 8000 снаружи, проксируем на 80 внутри
depends_on:
- etpgrf-backend
volumes:
static_volume: