selfhost/git/docker-compose.yaml
2024-12-06 16:02:20 +01:00

57 lines
1.2 KiB
YAML

services:
forgejo:
image: codeberg.org/forgejo/forgejo:${FORGEJO_VERSION}
volumes:
- ${STORAGE_PATH}/forgejo_data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "2222:22"
networks:
- web
- git
depends_on:
- db
restart: unless-stopped
environment:
- USER_UID=1000
- USER_GID=1000
- DB_TYPE=mysql
- DB_TYPE=postgres
- DB_HOST=db:5432
- DB_NAME=${POSTGRES_DB}
- DB_USER=${POSTGRES_USER}
- DB_PASSWD=${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD", "curl" ,"--fail", "localhost:3000/api/healthz"]
interval: 5s
timeout: 3s
labels:
- "docker.group=git"
db:
image: postgres:${POSTGRES_VERSION}
restart: unless-stopped
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
networks:
- git
volumes:
- ${STORAGE_PATH}/forgejo_db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
labels:
- "docker.group=git"
networks:
git:
web:
external: true