67 lines
1.3 KiB
YAML
67 lines
1.3 KiB
YAML
version: "3.8"
|
|
|
|
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
|
|
|
|
# ── 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:
|
|
|
|
networks:
|
|
ev-net:
|
|
driver: bridge
|