# TravelHub full stack on Docker. Drive it with docker.ps1 (which supplies the # DB_* values from backend/.env), or run docker compose directly after exporting # DB_USER / DB_PASSWORD / DB_NAME yourself. # # PostgreSQL internal only (data in the pgdata volume) # api Go API -> http://localhost:8080 # web Angular via nginx -> http://localhost:4200 (proxies /api to api) services: postgres: image: postgres:17 environment: POSTGRES_USER: ${DB_USER:-postgres} POSTGRES_PASSWORD: ${DB_PASSWORD:?set DB_PASSWORD (docker.ps1 reads it from backend/.env)} POSTGRES_DB: ${DB_NAME:-travelhub} volumes: - pgdata:/var/lib/postgresql/data # Migrations run once, on first creation of an empty data directory, in # order (001_init, 002_seed, 003_demo_bookings). The seed generates # flights relative to now(), so a fresh volume always has future-dated # inventory. `docker.ps1 reset` wipes the volume to re-seed. - ./backend/migrations:/docker-entrypoint-initdb.d:ro healthcheck: test: ['CMD-SHELL', 'pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-travelhub}'] interval: 5s timeout: 5s retries: 12 restart: unless-stopped api: build: ./backend environment: DB_HOST: postgres DB_PORT: '5432' DB_USER: ${DB_USER:-postgres} DB_PASSWORD: ${DB_PASSWORD} DB_NAME: ${DB_NAME:-travelhub} DB_SSLMODE: disable PORT: '8080' CORS_ORIGINS: http://localhost:4200 depends_on: postgres: condition: service_healthy ports: - '8080:8080' restart: unless-stopped web: build: ./frontend depends_on: - api ports: - '4200:80' restart: unless-stopped volumes: pgdata: