version: "3.9" services: postgres: image: postgres:16 environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: orderflow ports: - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 redis: image: redis:7-alpine ports: - "6379:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 5s retries: 5 api: build: context: ./backend dockerfile: Dockerfile ports: - "8000:8000" environment: DATABASE_URL: postgresql+psycopg2://postgres:postgres@postgres:5432/orderflow REDIS_URL: redis://redis:6379/0 SECRET_KEY: change-this-in-production CORS_ORIGINS: http://localhost:3000,http://localhost:5173 depends_on: postgres: condition: service_healthy redis: condition: service_healthy frontend: build: context: ./frontend dockerfile: Dockerfile ports: - "3000:80" depends_on: - api volumes: pgdata: