72 lines
2.2 KiB
YAML
72 lines
2.2 KiB
YAML
services:
|
|
server:
|
|
image: docker.gitea.com/gitea:1.25.1
|
|
container_name: gitea
|
|
environment:
|
|
- USER_UID=1000
|
|
- USER_GID=1000
|
|
# Database
|
|
- GITEA__database__DB_TYPE=postgres
|
|
- GITEA__database__HOST=db:5432
|
|
- GITEA__database__USER=gitea
|
|
- GITEA__database__PASSWD=gitea
|
|
- GITEA__database__NAME=gitea
|
|
#Server
|
|
- GITEA__server__ROOT_URL=https://gitea.forust.xyz
|
|
- GITEA__server__SSH_PORT=2221
|
|
restart: always
|
|
networks:
|
|
- gitea-db
|
|
- traefik-proxy
|
|
volumes:
|
|
- ./gitea-data:/data
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.docker.network=traefik-proxy"
|
|
|
|
# Prod Router
|
|
- "traefik.http.routers.gitea.rule=Host(`gitea.forust.xyz`)"
|
|
- "traefik.http.routers.gitea.entrypoints=websecure"
|
|
- "traefik.http.routers.gitea.middlewares=security-headers"
|
|
- "traefik.http.routers.gitea.service=gitea"
|
|
- "traefik.http.routers.gitea.tls=true"
|
|
- "traefik.http.services.gitea.loadbalancer.server.port=3000"
|
|
|
|
# Local Router
|
|
- "traefik.http.routers.gitea-local.rule=Host(`gitea.workstation.local`) || Host(`gitea.local`)"
|
|
- "traefik.http.routers.gitea-local.entrypoints=websecure"
|
|
- "traefik.http.routers.gitea-local.middlewares=security-headers"
|
|
- "traefik.http.routers.gitea-local.service=gitea"
|
|
- "traefik.http.routers.gitea-local.tls=true"
|
|
|
|
# Dev Router
|
|
- "traefik.http.routers.gitea-dev.rule=Host(`gitea.gigaforust.local`)"
|
|
- "traefik.http.routers.gitea-dev.entrypoints=websecure"
|
|
- "traefik.http.routers.gitea-dev.middlewares=security-headers"
|
|
- "traefik.http.routers.gitea-dev.service=gitea"
|
|
- "traefik.http.routers.gitea-dev.tls=true"
|
|
ports:
|
|
- "2221:22"
|
|
depends_on:
|
|
- db
|
|
|
|
db:
|
|
image: docker.io/library/postgres:14
|
|
restart: always
|
|
environment:
|
|
- POSTGRES_USER=gitea
|
|
- POSTGRES_PASSWORD=gitea
|
|
- POSTGRES_DB=gitea
|
|
networks:
|
|
- gitea-db
|
|
volumes:
|
|
- ./gitea-db/:/var/lib/postgresql/data
|
|
|
|
networks:
|
|
gitea-db:
|
|
external: false
|
|
traefik-proxy:
|
|
external: true
|