services:
  # 主应用服务
  epaper_server:
    image: epaper_server:latest
    build:
      context: .
      dockerfile: Dockerfile
    container_name: epaper_server
    ports:
      - "8199:8199"
    volumes:
      - ./static:/app/static
      - ./:/app
    env_file:
      - .env.docker
    depends_on:
      - luna-mqtt
    restart: unless-stopped
    networks:
      - luna-network

  # MQTT服务 (使用Eclipse Mosquitto)
  luna-mqtt:
    image: eclipse-mosquitto:2.0
    container_name: luna-mqtt
    ports:
      - "1883:1883"
      - "9001:9001"
    volumes:
      - ./mosquitto.conf:/mosquitto/config/mosquitto.conf
      - mosquitto_data:/mosquitto/data
      - mosquitto_logs:/mosquitto/log
      - mosquitto_config:/mosquitto/config
    restart: unless-stopped
    networks:
      - luna-network

# 数据卷
volumes:
  mosquitto_data:
  mosquitto_logs:
  mosquitto_config:

# 网络
networks:
  luna-network:
    driver: bridge