services:
  app:
    image: zhian-renwuguanli:0307
    container_name: zhian-app
    restart: unless-stopped
    depends_on:
      - db
      - minio
    environment:
      DATABASE_URL: "${DATABASE_URL}"
      JWT_SECRET: "${JWT_SECRET}"
      MINIO_ENDPOINT: "${MINIO_ENDPOINT}"
      MINIO_ACCESS_KEY: "${MINIO_ACCESS_KEY}"
      MINIO_SECRET_KEY: "${MINIO_SECRET_KEY}"
      MINIO_BUCKET: "${MINIO_BUCKET}"
      NODE_ENV: "${NODE_ENV:-production}"
      TZ: "${TZ:-Asia/Shanghai}"
      COOKIE_SECURE: "${COOKIE_SECURE:-false}"
      MONITOR_JOB_TOKEN: "${MONITOR_JOB_TOKEN}"
      MONITOR_INSTANCE_LOOKAHEAD_DAYS: "${MONITOR_INSTANCE_LOOKAHEAD_DAYS:-60}"
      MONITOR_INSTANCE_BACKFILL_DAYS: "${MONITOR_INSTANCE_BACKFILL_DAYS:-7}"
      MONITOR_NOTIFY_RETRY_LIMIT: "${MONITOR_NOTIFY_RETRY_LIMIT:-5}"
      MONITOR_SMS_DRIVER: "${MONITOR_SMS_DRIVER:-mock}"
      ORACLE_SMS_USER: "${ORACLE_SMS_USER:-}"
      ORACLE_SMS_PASSWORD: "${ORACLE_SMS_PASSWORD:-}"
      ORACLE_SMS_CONNECT_STRING: "${ORACLE_SMS_CONNECT_STRING:-}"
      ORACLE_SMS_TABLE: "${ORACLE_SMS_TABLE:-SMS_QUEUE}"
      ORACLE_SMS_INSERT_SQL: "${ORACLE_SMS_INSERT_SQL:-}"
      ORACLE_SMS_EXISTS_SQL: "${ORACLE_SMS_EXISTS_SQL:-}"
      ORACLE_SMS_QUEUE_USERID: "${ORACLE_SMS_QUEUE_USERID:-}"
      ORACLE_SMS_QUEUE_PASSWORD: "${ORACLE_SMS_QUEUE_PASSWORD:-}"
      ORACLE_SMS_USERPORT: "${ORACLE_SMS_USERPORT:-0006}"
      ORACLE_CLIENT_LIB_DIR: "${ORACLE_CLIENT_LIB_DIR:-/opt/oracle/instantclient}"
    ports:
      - "3000:3000"

  db:
    image: postgres:17
    container_name: zhian-postgres
    restart: unless-stopped
    environment:
      POSTGRES_USER: "${POSTGRES_USER:-postgres}"
      POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-Asd@199312}"
      POSTGRES_DB: "${POSTGRES_DB:-postgres}"
      TZ: "${TZ:-Asia/Shanghai}"
    ports:
      - "5432:5432"
    volumes:
      - db_data:/var/lib/postgresql/data

  minio:
    image: minio/minio:latest
    container_name: zhian-minio
    restart: unless-stopped
    command: server /data --console-address ":9001"
    environment:
      MINIO_ROOT_USER: "minioadmin"
      MINIO_ROOT_PASSWORD: "minioadmin"
    ports:
      - "9000:9000"
      - "9001:9001"
    volumes:
      - minio_data:/data

volumes:
  db_data:
  minio_data:
