80 lines
1.6 KiB
YAML
80 lines
1.6 KiB
YAML
version: "3"
|
|
|
|
networks:
|
|
gitea:
|
|
external: false
|
|
|
|
volumes:
|
|
gitea:
|
|
driver: local
|
|
|
|
services:
|
|
server:
|
|
image: docker.gitea.com/gitea:nightly
|
|
container_name: gitea
|
|
environment:
|
|
- USER_UID=1001
|
|
- USER_GID=1001
|
|
- GITEA__database__DB_TYPE=postgres
|
|
- GITEA__database__HOST=db:5432
|
|
- GITEA__database__NAME=gitea
|
|
- GITEA__database__USER=gitea
|
|
- GITEA__database__PASSWD=gitea
|
|
restart: always
|
|
networks:
|
|
- gitea
|
|
volumes:
|
|
- gitea:/data
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
ports:
|
|
- "22:22"
|
|
depends_on:
|
|
- db
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--spider", "--quiet", "http://localhost:3000"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
db:
|
|
image: docker.io/library/postgres:14
|
|
restart: always
|
|
environment:
|
|
- POSTGRES_USER=gitea
|
|
- POSTGRES_PASSWORD=gitea
|
|
- POSTGRES_DB=gitea
|
|
networks:
|
|
- gitea
|
|
volumes:
|
|
- ./postgres:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U gitea"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: gitea-proxy
|
|
restart: always
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./nginx/conf.d:/etc/nginx/conf.d:ro
|
|
- ./nginx/certs:/etc/nginx/certs:ro
|
|
depends_on:
|
|
- server
|
|
networks:
|
|
- gitea
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--spider", "--quiet", "http://localhost"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
|