services:
  siyuan:
    image: ${SIYUAN_IMAGE:-b3log/siyuan:latest}
    container_name: siyuan
    restart: unless-stopped
    command:
      - --workspace=/siyuan/workspace/
      - --accessAuthCode=${SIYUAN_ACCESS_CODE:?请在 .env 中设置 SIYUAN_ACCESS_CODE}
    environment:
      - TZ=Asia/Shanghai
      - PUID=${SIYUAN_PUID:-1000}
      - PGID=${SIYUAN_PGID:-1000}
    volumes:
      - ${SIYUAN_DATA_DIR:-/data/siyuan/workspace}:/siyuan/workspace
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "127.0.0.1:6806:6806"
    healthcheck:
      test: ["CMD", "wget", "-qO", "/dev/null", "http://127.0.0.1:6806"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 15s
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"
