109 lines
2.6 KiB
YAML
109 lines
2.6 KiB
YAML
version: '3.8'
|
|
|
|
x-traefik-enable-labels: &traefik-labels
|
|
traefik.enable: "true"
|
|
traefik.swarm.network: "traefik"
|
|
traefik.constraint-label: "traefik"
|
|
|
|
x-api-deploy: &api-deployment
|
|
mode: replicated
|
|
update_config:
|
|
parallelism: 1
|
|
delay: 5s
|
|
order: start-first
|
|
failure_action: rollback
|
|
rollback_config:
|
|
order: start-first
|
|
restart_policy:
|
|
condition: on-failure
|
|
delay: 5s
|
|
max_attempts: 3
|
|
window: 120s
|
|
|
|
|
|
services:
|
|
gitea:
|
|
image: gitea/gitea:1.23.7
|
|
environment:
|
|
- USER_UID=1000
|
|
- USER_GID=1000
|
|
- GITEA__database__DB_TYPE=mysql
|
|
- GITEA__database__HOST=database:3306
|
|
- GITEA__database__NAME=gitea
|
|
- GITEA__database__USER=gitea
|
|
- GITEA__database__PASSWD=${GITEA_DB_PASSWORD}
|
|
- GITEA__server__ROOT_URL=https://gitea.szabolcsi.dev
|
|
- GITEA__admin__DISABLE_REGULAR_ORG_CREATION=true
|
|
- GITEA__service__DISABLE_REGISTRATION=true
|
|
- GITEA__service__DEFAULT_USER_VISIBILITY=private
|
|
- GITEA__service__DEFAULT_ORG_VISIBILITY=private
|
|
- GITEA__session__PROVIDER=file
|
|
networks:
|
|
- local
|
|
- traefik
|
|
volumes:
|
|
- gitea:/data
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
ports:
|
|
- "222:22"
|
|
deploy:
|
|
replicas: 1
|
|
<<: *api-deployment
|
|
labels:
|
|
<<: *traefik-labels
|
|
traefik.http.routers.gitea.rule: "Host(`gitea.szabolcsi.dev`)"
|
|
traefik.http.routers.gitea.entrypoints: "https"
|
|
traefik.http.routers.gitea.tls: "true"
|
|
traefik.http.routers.gitea.tls.certresolver: "letsencrypt"
|
|
traefik.http.services.gitea.loadbalancer.server.port: "3000"
|
|
#traefik.http.services.gitea.loadbalancer.healthCheck.path: "/"
|
|
#traefik.http.services.gitea.loadbalancer.healthCheck.interval: "30s"
|
|
#traefik.http.services.gitea.loadbalancer.healthCheck.timeout: "1s"
|
|
|
|
|
|
proxy:
|
|
image: haproxy:3.1.7-alpine
|
|
networks:
|
|
local:
|
|
aliases:
|
|
- database
|
|
database:
|
|
aliases:
|
|
- services-proxy
|
|
configs:
|
|
- source: haproxy
|
|
target: /usr/local/etc/haproxy/haproxy.cfg
|
|
deploy:
|
|
replicas: 1
|
|
<<: *api-deployment
|
|
|
|
|
|
|
|
networks:
|
|
local:
|
|
name: services
|
|
driver: overlay
|
|
internal: true
|
|
ipam:
|
|
config:
|
|
- subnet: 172.30.14.0/24
|
|
traefik:
|
|
external: true
|
|
database:
|
|
external: true
|
|
|
|
volumes:
|
|
gitea:
|
|
name: gitea-data
|
|
driver: local
|
|
driver_opts:
|
|
type: nfs
|
|
device: ":/nfs_share/services/gitea"
|
|
o: "addr=10.0.0.3,rw,soft,nfsvers=4"
|
|
|
|
configs:
|
|
haproxy:
|
|
name: "${HAPROXY_CONFIG_NAME}"
|
|
external: true
|