services:
  server:
    image: gitea/gitea:1.24-nightly-rootless
    restart: always
    environment:
      - USER_UID=1000  # 根据宿主机实际用户uid，gid设置，一般默认为1000
      - USER_GID=1000
    volumes:
      - /opt/docker.d/gitea/data:/var/lib/gitea  # 数据
      - /opt/docker.d/gitea/config:/etc/gitea    # 配置
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"   # Web界面
      - "2222:2222"   # SSH端口
    networks:
      gitea: {}

networks:
  gitea:
    external: true

