# docker-compose.base.yml # 기본 서비스 정의 (공통 설정) version: "3.8" services: fems-admin: build: context: ./fems-admin target: ${NODE_ENV:-development} container_name: fems-admin restart: unless-stopped env_file: - .env.${NODE_ENV:-development} volumes: - ./fems-admin:/app - /app/node_modules environment: - NODE_ENV=${NODE_ENV:-development} logging: driver: "json-file" options: max-size: "10m" max-file: "3" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000/health"] interval: 30s timeout: 10s retries: 3 depends_on: - fems-api fems-app: build: context: ./fems-app target: ${NODE_ENV:-development} container_name: fems-app restart: unless-stopped env_file: - .env.${NODE_ENV:-development} volumes: - ./fems-app:/app - /app/node_modules environment: - NODE_ENV=${NODE_ENV:-development} depends_on: - fems-api fems-api: build: context: ./fems-api target: ${NODE_ENV:-development} container_name: fems-api restart: unless-stopped env_file: - .env.${NODE_ENV:-development} volumes: - ./fems-api:/app - /app/node_modules environment: - NODE_ENV=${NODE_ENV:-development} depends_on: - postgres # - redis healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3001/health"] interval: 30s timeout: 10s retries: 3 postgres: image: postgres:16 container_name: postgres restart: unless-stopped env_file: - .env.${NODE_ENV:-development} environment: - NODE_ENV=${NODE_ENV:-development} - LANG=en_US.utf8 - LC_ALL=en_US.utf8 - POSTGRES_HOST_AUTH_METHOD=scram-sha-256 - POSTGRES_INITDB_ARGS=--auth-host=scram-sha-256 --auth-local=scram-sha-256 volumes: - postgres_data:/var/lib/postgresql/data - ./backups/postgres:/backups - ./init-scripts:/docker-entrypoint-initdb.d command: - "postgres" - "-c" - "max_connections=100" - "-c" - "shared_buffers=128MB" healthcheck: test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-postgres}", ] interval: 30s timeout: 10s retries: 3 # healthcheck: # test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] # interval: 30s # timeout: 10s # retries: 3 # redis: # image: redis:alpine # restart: unless-stopped # env_file: # - .env.${NODE_ENV:-development} # command: # [ # "redis-server", # "--requirepass", # "${NODE_ENV:-development:-REDIS_PASSWORD}", # ] # volumes: # - redis_data:/data # - ./backups/redis:/backups # environment: # - NODE_ENV=${NODE_ENV:-development} # - REDIS_PASSWORD=${NODE_ENV:-development:-REDIS_PASSWORD} # depends_on: # - postgres # healthcheck: # test: ["CMD", "redis-cli", "ping"] # interval: 30s # timeout: 10s # retries: 3 # redis-commander: # image: rediscommander/redis-commander:latest # restart: unless-stopped # env_file: # - .env.${NODE_ENV:-development} # ports: # - "8081:8081" # environment: # - REDIS_HOSTS=local:redis:6379 # - REDIS_PASSWORD=${NODE_ENV:-development:-REDIS_PASSWORD} # depends_on: # - redis