services:
  backend:
    build:
      context: .
    container_name: mengyastore-backend
    ports:
      - "28081:8080"
    environment:
      # 生产环境（本地开发请使用 APP_ENV=development + 根目录 .env.development，或 ENV_FILE）
      APP_ENV: production
      GIN_MODE: release
      TZ: Asia/Shanghai
      # 通过宿主机 .env 或 export 注入，勿在仓库中写真实 DSN/口令
      DATABASE_DSN: ${DATABASE_DSN:-}
      ADMIN_TOKEN: ${ADMIN_TOKEN:-changeme}
      AUTH_API_URL: ${AUTH_API_URL:-}
      REDIS_ENABLED: "false"
      REDIS_ADDR: ${REDIS_ADDR:-127.0.0.1:6379}
      REDIS_PASSWORD: ${REDIS_PASSWORD:-}
      REDIS_DB: ${REDIS_DB:-1}
      RABBITMQ_ENABLED: "false"
      RABBITMQ_ENV: prod
      RABBITMQ_URL: ${RABBITMQ_URL}
    restart: unless-stopped
