Files
runners-calendar/docker-compose.stack.yml
2026-04-08 00:22:11 +03:00

55 lines
1.7 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.
# Backend + frontend в сети с уже поднятым PostgreSQL (external network).
#
# Подготовка: из корня репозитория скопируйте .env.example → .env и задайте DB_*
# и CORS_ORIGIN (для фронта на :3033 — http://localhost:3033).
#
# Сеть (имя должно существовать, как у вашего Postgres):
# docker network ls
#
# Запуск:
# docker compose -f docker-compose.stack.yml up -d --build
#
# Миграции и seed (один раз после появления БД):
# docker compose -f docker-compose.stack.yml exec backend node dist/migrate.js
# docker compose -f docker-compose.stack.yml exec backend node dist/seed.js
#
# NPM: проброс на порт 3033. Браузер ходит на /api → nginx во фронте → backend:3000.
services:
backend:
build:
context: .
dockerfile: Dockerfile.backend
container_name: runners-calendar-backend
env_file:
- .env
environment:
- PORT=3000
ports:
- "3001:3000"
volumes:
# CSV и прочие данные import/ на хосте (Synology: ./import рядом с compose) без пересборки образа
- ./import:/app/import:ro
restart: unless-stopped
networks:
- postgres_default
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
args:
VITE_API_BASE_URL: /api
container_name: runners-calendar-frontend
depends_on:
- backend
ports:
- "3033:80"
restart: unless-stopped
networks:
- postgres_default
networks:
postgres_default:
external: true