services: # ── FastAPI 백엔드 ── api: build: . container_name: ev-api restart: unless-stopped ports: - "8000:8000" env_file: - .env depends_on: postgres: condition: service_healthy redis: condition: service_healthy volumes: - ./app:/code/app - ./dashboard.html:/code/dashboard.html:ro - ./simulator.html:/code/simulator.html:ro networks: - ev-net # ── OCPP 프록시 서버 ── proxy: build: context: . dockerfile: Dockerfile.proxy container_name: ev-proxy restart: unless-stopped ports: - "9002:9002" - "9003:9003" volumes: - ./ocpp_proxy_server.py:/code/ocpp_proxy_server.py:ro - ./proxy_control.html:/code/proxy_control.html:ro - proxy_logs:/code/ocpp_logs - proxy_config:/code/config networks: - ev-net # ── PostgreSQL ── postgres: image: postgres:16-alpine container_name: ev-postgres restart: unless-stopped environment: POSTGRES_DB: ${POSTGRES_DB:-ev_charging} POSTGRES_USER: ${POSTGRES_USER:-evuser} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-evpass1234} ports: - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-evuser}"] interval: 5s timeout: 3s retries: 5 networks: - ev-net # ── Redis ── redis: image: redis:7-alpine container_name: ev-redis restart: unless-stopped ports: - "6375:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 5 networks: - ev-net volumes: pgdata: proxy_logs: proxy_config: networks: ev-net: driver: bridge