name: o2o-weather services: # 운영형: docker compose up --build → http://localhost:8080 frontend: build: context: ./frontend target: prod ports: - "8080:80" restart: unless-stopped # 개발형: docker compose --profile dev up --build frontend-dev → http://localhost:5173 frontend-dev: profiles: ["dev"] build: context: ./frontend target: dev ports: - "5173:5173" volumes: - ./frontend:/app - /app/node_modules environment: - CHOKIDAR_USEPOLLING=true # 백엔드 API: http://localhost:9810/docs backend: build: ./backend command: ["python", "web_main.py"] env_file: .env environment: PORT: "9800" DB_HOST: postgres DB_PORT: "5432" REDIS_HOST: redis REDIS_PORT: "6379" ports: - "9810:9800" depends_on: postgres: condition: service_healthy redis: condition: service_healthy restart: unless-stopped # 매일 03:00 스케줄 1개 (포트 없음) worker: build: ./backend command: ["python", "worker_main.py"] env_file: .env environment: DB_HOST: postgres DB_PORT: "5432" REDIS_HOST: redis REDIS_PORT: "6379" healthcheck: disable: true depends_on: postgres: condition: service_healthy redis: condition: service_healthy restart: unless-stopped postgres: image: pgvector/pgvector:pg16 environment: POSTGRES_USER: ${DB_USER} POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_DB: ${DB_NAME} ports: - "5440:5432" volumes: - pgdata:/var/lib/postgresql/data - ./backend/postgres-init:/docker-entrypoint-initdb.d:ro healthcheck: test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"] interval: 5s timeout: 3s retries: 10 restart: unless-stopped redis: image: redis:7-alpine command: ["redis-server", "--appendonly", "yes"] ports: - "6390:6379" volumes: - redisdata:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 10 restart: unless-stopped volumes: pgdata: redisdata: