chore(docker): stack compose with env_file, no secrets in repo
Some checks failed
CI / build-and-test (pull_request) Has been cancelled
Some checks failed
CI / build-and-test (pull_request) Has been cancelled
- docker-compose.stack.env for DB_* and CORS (gitignored) - docker-compose.stack.env.example with placeholders - .dockerignore excludes local stack env from build context Made-with: Cursor
This commit is contained in:
47
docker-compose.stack.yml
Normal file
47
docker-compose.stack.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
# Запуск приложения в сети с уже поднятым PostgreSQL (как у family-budget).
|
||||
#
|
||||
# 1) Скопируйте пример переменных (не коммитьте файл с паролями):
|
||||
# cp docker-compose.stack.env.example docker-compose.stack.env
|
||||
# отредактируйте docker-compose.stack.env
|
||||
#
|
||||
# NPM / reverse proxy: проброс на порт фронта 3033 (внутри контейнера nginx слушает 80).
|
||||
# Фронт в браузере ходит на /api → nginx проксирует на backend:3000.
|
||||
#
|
||||
# Первая инициализация БД (один раз, когда Postgres уже доступен по DB_HOST):
|
||||
# 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
|
||||
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.backend
|
||||
container_name: runners-calendar-backend
|
||||
env_file:
|
||||
- docker-compose.stack.env
|
||||
environment:
|
||||
- PORT=3000
|
||||
ports:
|
||||
- "3001:3000"
|
||||
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
|
||||
Reference in New Issue
Block a user