version: '3.8'

services:
  mengya-profile:
    build: .
    container_name: mengya-profile
    restart: unless-stopped
    ports:
      - "5000:5000"  # 后端 API 端口
    volumes:
      - /shumengya/docker/storage/mengyaprofile/data:/app/data:rw
      - /shumengya/docker/storage/mengyaprofile/background:/app/frontend/build/background:rw
    environment:
      - PYTHONUNBUFFERED=1
      - DATA_DIR=/app/data
      - RUN_MODE=production
    healthcheck:
      test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/api/all')"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
    networks:
      - mengya-network

networks:
  mengya-network:
    driver: bridge
