services:
  app:
    image: gitea/gitea:1.21
    volumes:
      - ./docker/app/data:/data
    ports:
      - "30000:30000"
      - "2200:2200"
    depends_on:
      - db
    restart: always
    environment:
      - SSH_PORT=2200
      - HTTP_PORT=30000

      - DB_TYPE=postgres
      - DB_HOST=db:5432
      - DB_NAME=gitea
      - DB_USER=gitea
      - DB_PASSWD=gitea
      - OFFLINE_MODE=true
      - MINIMUM_KEY_SIZE_CHECK=true

      - DISABLE_REGISTRATION=true
  db:
    image: postgres:15.2-alpine3.17
    restart: always
    environment:
      - POSTGRES_USER=gitea
      - POSTGRES_PASSWORD=gitea
      - POSTGRES_DB=gitea
    volumes:
      - ./docker/db:/var/lib/postgresql/data

# 重置密码
# useradd git
# su git
# gitea admin user change-password --username git --password 12345678  --config /data/gitea/conf/app.ini
