feat: update Guidelines

This commit is contained in:
Sun-ZhenXing
2025-10-15 14:00:03 +08:00
parent fe329c80eb
commit 8cf227bd14
76 changed files with 1078 additions and 671 deletions

View File

@@ -1,33 +1,31 @@
x-default: &default
restart: unless-stopped
volumes:
- &localtime /etc/localtime:/etc/localtime:ro
- &timezone /etc/timezone:/etc/timezone:ro
logging:
driver: json-file
options:
max-size: 100m
max-file: "3"
services:
gitea:
<<: *default
image: gitea/gitea:${GITEA_VERSION:-1.24.6-rootless}
environment:
- TZ=${TZ:-UTC}
- GITEA__database__DB_TYPE=${GITEA_DB_TYPE:-postgres}
- GITEA__database__HOST=${GITEA_POSTGRES_HOST:-db:5432}
- GITEA__database__USER=${POSTGRES_USER:-gitea}
- GITEA__database__NAME=${POSTGRES_DB:-gitea}
- GITEA__database__PASSWD=${POSTGRES_PASSWORD:-gitea}
volumes:
- *localtime
- *timezone
- gitea_data:/var/lib/gitea
- ./config:/etc/gitea
ports:
- "${GITEA_HTTP_PORT:-3000}:3000"
- "${GITEA_SSH_PORT:-3022}:22"
depends_on:
- db
db:
condition: service_healthy
deploy:
resources:
limits:
@@ -36,17 +34,22 @@ services:
reservations:
cpus: '0.5'
memory: 512M
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
db:
<<: *default
image: postgres:${POSTGRES_VERSION:-17.6}
environment:
- TZ=${TZ:-UTC}
- POSTGRES_USER=${POSTGRES_USER:-gitea}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-gitea}
- POSTGRES_DB=${POSTGRES_DB:-gitea}
volumes:
- *localtime
- *timezone
- postgres:/var/lib/postgresql/data
deploy:
resources:
@@ -56,6 +59,12 @@ services:
reservations:
cpus: '0.5'
memory: 512M
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
volumes:
gitea_data: