deployment/stacks/gitea.yml

66 lines
1.3 KiB
YAML
Raw Normal View History

2021-12-24 11:56:14 +01:00
version: '3.4'
2021-12-18 10:35:43 +01:00
services:
2021-12-24 17:33:41 +01:00
app:
# Latest contains a development version
2022-02-18 13:30:59 +01:00
image: 'gitea/gitea:1.16.1'
2021-12-24 17:33:41 +01:00
deploy:
mode: 'replicated'
replicas: 1
placement:
constraints:
- 'node.labels.class==gitea'
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.gitea.rule=Host(`git.rustybever.be`)'
- 'traefik.http.routers.gitea.tls=true'
- 'traefik.http.routers.gitea.tls.certresolver=letsEncrypt'
- 'traefik.http.services.gitea.loadbalancer.server.port=3000'
2021-12-18 10:35:43 +01:00
2021-12-24 17:33:41 +01:00
networks:
- 'default'
- 'public'
ports:
- '22:22'
volumes:
- 'data:/data'
- 'repos:/data/git/repositories'
- 'lfs:/data/git/lfs'
- '/etc/timezone:/etc/timezone:ro'
- '/etc/localtime:/etc/localtime:ro'
2021-12-18 10:35:43 +01:00
2021-12-24 17:33:41 +01:00
db:
2022-02-18 13:30:59 +01:00
image: 'postgres:14.2-alpine'
2021-12-24 11:52:32 +01:00
2021-12-24 17:33:41 +01:00
deploy:
mode: 'replicated'
replicas: 1
placement:
constraints:
- 'node.labels.class==gitea'
2021-12-18 10:35:43 +01:00
2021-12-24 11:52:32 +01:00
healthcheck:
2022-02-18 13:30:59 +01:00
test: pg_isready -U gitea
2021-12-24 11:52:32 +01:00
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
2021-12-24 17:33:41 +01:00
environment:
- 'POSTGRES_USER=gitea'
- 'POSTGRES_PASSWORD=gitea'
- 'POSTGRES_DB=gitea'
volumes:
- 'db-data:/var/lib/postgresql/data'
2021-12-18 10:35:43 +01:00
networks:
2021-12-24 17:33:41 +01:00
public:
external: true
2021-12-18 10:35:43 +01:00
volumes:
data:
db-data:
repos:
lfs: