services:
  cointrader:
    image: git.gihyeon.com/gihyeon/cointrader:latest
    container_name: cointrader
    restart: unless-stopped
    env_file:
      - .env
    environment:
      - TZ=Asia/Seoul
    volumes:
      - ./logs:/app/logs
      - ./models:/app/models
      - ./data:/app/data
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "5"

  dashboard-api:
    image: git.gihyeon.com/gihyeon/cointrader-dashboard-api:latest
    container_name: dashboard-api
    restart: unless-stopped
    environment:
      - TZ=Asia/Seoul
      - PYTHONUNBUFFERED=1
      - LOG_DIR=/app/logs
      - DB_PATH=/app/data/dashboard.db
      - POLL_INTERVAL=5
    volumes:
      - ./logs:/app/logs:ro
      - dashboard-data:/app/data
    depends_on:
      - cointrader
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

  dashboard-ui:
    image: git.gihyeon.com/gihyeon/cointrader-dashboard-ui:latest
    container_name: dashboard-ui
    restart: unless-stopped
    ports:
      - "8080:3000"
    depends_on:
      - dashboard-api
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

  mtf-bot:
    image: git.gihyeon.com/gihyeon/cointrader:latest
    container_name: mtf-bot
    restart: unless-stopped
    env_file:
      - .env
    environment:
      - TZ=Asia/Seoul
      - PYTHONUNBUFFERED=1
    volumes:
      - ./logs:/app/logs
      - ./data:/app/data
    entrypoint: ["python", "main_mtf.py"]
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "5"

  ls-ratio-collector:
    image: git.gihyeon.com/gihyeon/cointrader:latest
    container_name: ls-ratio-collector
    restart: unless-stopped
    environment:
      - TZ=Asia/Seoul
      - PYTHONUNBUFFERED=1
    volumes:
      - ./data:/app/data
    entrypoint: ["sh", "scripts/collect_ls_ratio_loop.sh"]
    logging:
      driver: "json-file"
      options:
        max-size: "5m"
        max-file: "3"

volumes:
  dashboard-data:
