# 姜十三论坛 — Docker Compose 单服务部署
# 启动：docker compose up -d --build
# 或：make compose-up / build.bat -Target compose-up
#
# 默认 SQLite（数据在 /data）。换库示例：
#   JIANG13_DB_TYPE=postgres
#   JIANG13_DB_DSN=postgres://forum:secret@host:5432/jiang13?sslmode=disable
#   JIANG13_DB_TYPE=mysql
#   JIANG13_DB_DSN=forum:secret@tcp(host:3306)/jiang13?parseTime=true&loc=Local&charset=utf8mb4

services:
  jiang13:
    image: hangzhang714128/jiang13-forum:latest
    build:
      context: .
      dockerfile: Dockerfile
      args:
        VERSION: dev
    ports:
      - "3000:3000"
    volumes:
      - jiang13-data:/data
    environment:
      TZ: Asia/Shanghai
      # JIANG13_DB_TYPE: sqlite
      # JIANG13_HTTP_PORT: "3000"
    restart: unless-stopped
    stop_grace_period: 15s
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3000/health"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 15s

volumes:
  jiang13-data:
