deployment/stacks/gitea.yml

93 lines
2.0 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
image: 'gitea/gitea:1.15.8'
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:43:26 +01:00
configs:
- source: gitea_v2
target: /data/gitea/conf/app.ini
2021-12-24 17:33:41 +01:00
environment:
2021-12-24 17:43:26 +01:00
- 'LFS_JWT_SECRET_FILE=/run/secrets/gitea_lfs_jwt_secret'
- 'SECRET_KEY_FILE=/run/secrets/gitea_secret_key'
- 'INTERNAL_TOKEN_FILE=/run/secrets/gitea_internal_token'
- 'JWT_SECRET_FILE=/run/secrets/gitea_jwt_secret'
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'
secrets:
- gitea_internal_token
- gitea_jwt_secret
- gitea_lfs_jwt_secret
- gitea_secret_key
2021-12-18 10:35:43 +01:00
2021-12-24 17:33:41 +01:00
db:
image: 'postgres:14.1-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:
test: pg_isready
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
configs:
2021-12-24 17:43:26 +01:00
gitea_v2:
external: true
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
secrets:
gitea_internal_token:
external: true
gitea_jwt_secret:
external: true
gitea_lfs_jwt_secret:
external: true
gitea_secret_key:
external: true
2021-12-18 10:35:43 +01:00
volumes:
data:
db-data:
repos:
lfs: