49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
services:
|
|
gitea:
|
|
image: gitea/gitea:latest
|
|
container_name: gitea
|
|
restart: unless-stopped
|
|
ports:
|
|
- "33000:3000"
|
|
- "32222:32222"
|
|
volumes:
|
|
# 使用 Docker 命名卷持久化
|
|
- gitea-data:/data
|
|
# 时区同步
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
environment:
|
|
- USER_UID=1000
|
|
- USER_GID=1000
|
|
- GITEA__database__DB_TYPE=sqlite3
|
|
- GITEA__database__PATH=/data/gitea/gitea.db
|
|
- GITEA__server__DOMAIN=192.168.1.83
|
|
- GITEA__server__SSH_DOMAIN=192.168.1.83
|
|
- GITEA__server__ROOT_URL=http://192.168.1.83:33000/
|
|
- GITEA__server__DISABLE_SSH=false
|
|
- GITEA__server__SSH_PORT=32222
|
|
- GITEA__server__SSH_LISTEN_PORT=32222
|
|
- GITEA__server__START_SSH_SERVER=true
|
|
- GITEA__server__LFS_START_SERVER=true
|
|
- GITEA__server__BUILTIN_SSH_SERVER_USER=git
|
|
- GITEA__repository__ENABLE_PUSH_CREATE_USER=true
|
|
- GITEA__repository__ENABLE_PUSH_CREATE_ORG=true
|
|
- GITEA__webhook__ALLOWED_HOST_LIST=localhost,jenkins,192.168.1.83
|
|
- GITEA__service__DISABLE_REGISTRATION=false # 允许注册
|
|
- GITEA__service__REQUIRE_SIGNIN_VIEW=false
|
|
- GITEA__actions__ENABLED=true # 启用Actions
|
|
networks:
|
|
- cicd-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3000/api/healthz"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
networks:
|
|
cicd-network:
|
|
external: true
|
|
|
|
volumes:
|
|
gitea-data:
|
|
driver: local |