services: db: image: postgres:16 env_file: - .env ports: - "${SPGW_DB_PORT}:5432" volumes: - ${DATA_PATH:-../data}/postgres:/var/lib/postgresql/data - ./db/init-db.sh:/docker-entrypoint-initdb.d/speech-gateway-init-db.sh:ro healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"] interval: 10s timeout: 5s retries: 5 start_period: 30s restart: unless-stopped pgadmin4: image: dpage/pgadmin4:8.14 env_file: - .env ports: - "${PGADMIN_PORT}:80" volumes: - ${DATA_PATH:-../data}/pgadmin:/var/lib/pgadmin - ./pgadmin/pgadmin-servers.json:/pgadmin4/servers.json depends_on: db: condition: service_healthy restart: unless-stopped app: build: context: . dockerfile: Dockerfile.app env_file: - .env ports: - "${SPGW_PORT}:8000" command: ["uvicorn", "run:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] volumes: - ./app:/app # Comment out for production (use code in image) - ${DATA_PATH:-../data}/app:/data depends_on: db: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/docs"] interval: 30s timeout: 10s retries: 3 start_period: 40s restart: unless-stopped