selfhost/git/docker-compose.yaml

60 lines
1.7 KiB
YAML
Raw Normal View History

2023-02-23 11:28:01 +01:00
services:
web:
2023-04-17 11:55:22 +02:00
image: codeberg.org/forgejo/forgejo:${FORGEJO_VERSION}
2023-02-23 11:28:01 +01:00
volumes:
- ${VOLUMES_PATH}/git/forgejo_data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "2222:22"
networks:
- web
- git
labels:
- "traefik.enable=true"
- "traefik.http.routers.forgejo.rule=Host(`gitea.${DOMAIN}`, `git.${DOMAIN}`)"
- "traefik.http.routers.forgejo.entrypoints=websecure"
- "traefik.http.routers.forgejo.tls.certresolver=netcup"
- "traefik.http.routers.forgejo.tls.options=intermediate@file"
- "traefik.http.routers.forgejo.middlewares=gitearedir"
- "traefik.http.middlewares.gitearedir.redirectregex.regex=^https://gitea.${DOMAIN}/(.*)"
- "traefik.http.middlewares.gitearedir.redirectregex.replacement=https://git.${DOMAIN}/$${1}"
- "traefik.http.middlewares.gitearedir.redirectregex.permanent=true"
- "traefik.http.services.forgejo.loadbalancer.server.port=3000"
- "docker.group=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}
db:
image: postgres:13
restart: unless-stopped
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
networks:
- git
volumes:
- ${VOLUMES_PATH}/git/forgejo_db:/var/lib/postgresql/data
labels:
- "docker.group=git"
networks:
git:
web:
external: true