services:
  fromis9-frontend:
    build: .
    container_name: fromis9-frontend
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    env_file:
      - .env
    # 개발 모드
    volumes:
      - ./backend:/app/backend
      - ./frontend:/app/frontend
      - backend_modules:/app/backend/node_modules
      - frontend_modules:/app/frontend/node_modules
    # 배포 모드 (사용 시 위 volumes를 주석처리)
    # volumes: []
    networks:
      - app
      - db
    restart: unless-stopped

  meilisearch:
    image: getmeili/meilisearch:v1.6
    container_name: fromis9-meilisearch
    environment:
      - MEILI_MASTER_KEY=${MEILI_MASTER_KEY}
    volumes:
      - ./meilisearch_data:/meili_data
    networks:
      - app
    restart: unless-stopped

  redis:
    image: redis:7-alpine
    container_name: fromis9-redis
    volumes:
      - ./redis_data:/data
    networks:
      - app
    restart: unless-stopped

volumes:
  backend_modules:
  frontend_modules:

networks:
  app:
    external: true
  db:
    external: true
