version: '2'
services:
  postgresql:
    image: docker.io/bitnami/postgresql:15
    volumes:
      - '/data/gitea/postgresql_data/:/bitnami/postgresql'
    environment:
      - POSTGRESQL_DATABASE=gitea_db
      - POSTGRESQL_USERNAME=bn_gitea
      - POSTGRESQL_PASSWORD=Superwdd.12
      # ALLOW_EMPTY_PASSWORD is recommended only for development.
  gitea:
    image: docker.io/bitnami/gitea:1.24.5-debian-12-r0
    volumes:
      - '/data/gitea/gitea_data:/bitnami/gitea'
    environment:
      - GITEA_DATABASE_HOST=postgresql
      - GITEA_DATABASE_NAME=gitea_db
      - GITEA_DATABASE_USERNAME=bn_gitea
      - GITEA_DATABASE_PASSWORD=Superwdd.12
      - GITEA_ADMIN_USER=zeaslity
      - GITEA_ADMIN_PASSWORD=loveff.cxc.23
      - GITEA_ADMIN_EMAIL=wdd@107421.xyz
      - GITEA_HTTP_PORT=3000
#      - GITEA_DOMAIN=gitea.107421.xyz
      - GITEA_ROOT_URL=https://gitea.107421.xyz
      - GITEA_SSH_LISTEN_PORT=22222
      - ARCHIVE_CLEANUP_ENABLED = true
      - ARCHIVE_CLEANUP_TIMEOUT = 168h #设置归档文件过期时间（默认7天）
    ports:
      - '3000:3000'
      - '22222:22222'