57 lines
1.7 KiB
YAML
57 lines
1.7 KiB
YAML
services:
|
|
api:
|
|
build: .
|
|
container_name: fitos-api
|
|
ports:
|
|
- "9002:9002"
|
|
environment:
|
|
DATABASE_URL: postgresql://fitos:fitos@db:5432/fitos
|
|
PORT: 9002
|
|
NODE_ENV: production
|
|
JWT_ACCESS_SECRET: ${JWT_ACCESS_SECRET:?set JWT_ACCESS_SECRET in .env}
|
|
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET:?set JWT_REFRESH_SECRET in .env}
|
|
FITOS_FIRST_ADMIN_EMAIL: ${FITOS_FIRST_ADMIN_EMAIL:-}
|
|
FITOS_FIRST_ADMIN_PASSWORD: ${FITOS_FIRST_ADMIN_PASSWORD:-}
|
|
LOG_LEVEL: ${LOG_LEVEL:-info}
|
|
COOKIE_SECURE: ${COOKIE_SECURE:-false}
|
|
UPLOAD_DIR: /app/uploads
|
|
# Daty treningowe (północ/23:59 dnia) liczone są w strefie procesu —
|
|
# kontener musi pracować w strefie użytkowników, nie w UTC.
|
|
TZ: ${TZ:-Europe/Warsaw}
|
|
volumes:
|
|
- fitos_uploads:/app/uploads
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://localhost:9002/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
restart: unless-stopped
|
|
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: fitos-db
|
|
ports:
|
|
# tylko localhost — sieć compose łączy kontenery przez DNS "db";
|
|
# bez tego Postgres z fitos/fitos jest wystawiony na всю sieć
|
|
- "127.0.0.1:5432:5432"
|
|
environment:
|
|
POSTGRES_USER: fitos
|
|
POSTGRES_PASSWORD: fitos
|
|
POSTGRES_DB: fitos
|
|
volumes:
|
|
- fitos_pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U fitos -d fitos"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
fitos_pgdata:
|
|
fitos_uploads:
|