Added healthcheck to gitea postgres
parent
417627385c
commit
f6ed76d01d
107
stacks/gitea.yml
107
stacks/gitea.yml
|
@ -1,63 +1,70 @@
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
# Latest contains a development version
|
# Latest contains a development version
|
||||||
image: 'gitea/gitea:1.15.8'
|
image: 'gitea/gitea:1.15.8'
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
mode: 'replicated'
|
mode: 'replicated'
|
||||||
replicas: 1
|
replicas: 1
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- 'node.labels.class==gitea'
|
- 'node.labels.class==gitea'
|
||||||
labels:
|
labels:
|
||||||
- 'traefik.enable=true'
|
- 'traefik.enable=true'
|
||||||
- 'traefik.http.routers.gitea.rule=Host(`git.rustybever.be`)'
|
- 'traefik.http.routers.gitea.rule=Host(`git.rustybever.be`)'
|
||||||
- 'traefik.http.routers.gitea.tls=true'
|
- 'traefik.http.routers.gitea.tls=true'
|
||||||
- 'traefik.http.routers.gitea.tls.certresolver=letsEncrypt'
|
- 'traefik.http.routers.gitea.tls.certresolver=letsEncrypt'
|
||||||
- 'traefik.http.services.gitea.loadbalancer.server.port=3000'
|
- 'traefik.http.services.gitea.loadbalancer.server.port=3000'
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
- 'DB_TYPE=postgres'
|
- 'DB_TYPE=postgres'
|
||||||
- 'DB_HOST=db:5432'
|
- 'DB_HOST=db:5432'
|
||||||
- 'DB_NAME=gitea'
|
- 'DB_NAME=gitea'
|
||||||
- 'DB_USER=gitea'
|
- 'DB_USER=gitea'
|
||||||
- 'DB_PASSWD=gitea'
|
- 'DB_PASSWD=gitea'
|
||||||
- 'LFS_START_SERVER=true'
|
- 'LFS_START_SERVER=true'
|
||||||
- 'DISABLE_REGISTRATION=true'
|
- 'DISABLE_REGISTRATION=true'
|
||||||
networks:
|
networks:
|
||||||
- 'default'
|
- 'default'
|
||||||
- 'public'
|
- 'public'
|
||||||
ports:
|
ports:
|
||||||
- '22:22'
|
- '22:22'
|
||||||
volumes:
|
volumes:
|
||||||
- 'data:/data'
|
- 'data:/data'
|
||||||
- 'repos:/data/git/repositories'
|
- 'repos:/data/git/repositories'
|
||||||
- 'lfs:/data/git/lfs'
|
- 'lfs:/data/git/lfs'
|
||||||
- '/etc/timezone:/etc/timezone:ro'
|
- '/etc/timezone:/etc/timezone:ro'
|
||||||
- '/etc/localtime:/etc/localtime:ro'
|
- '/etc/localtime:/etc/localtime:ro'
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: 'postgres:14.1-alpine'
|
image: 'postgres:14.1-alpine'
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
mode: 'replicated'
|
mode: 'replicated'
|
||||||
replicas: 1
|
replicas: 1
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- 'node.labels.class==gitea'
|
- 'node.labels.class==gitea'
|
||||||
|
|
||||||
environment:
|
healthcheck:
|
||||||
- 'POSTGRES_USER=gitea'
|
test: pg_isready
|
||||||
- 'POSTGRES_PASSWORD=gitea'
|
interval: 30s
|
||||||
- 'POSTGRES_DB=gitea'
|
timeout: 5s
|
||||||
volumes:
|
retries: 3
|
||||||
- 'db-data:/var/lib/postgresql/data'
|
start_period: 15s
|
||||||
|
|
||||||
|
environment:
|
||||||
|
- 'POSTGRES_USER=gitea'
|
||||||
|
- 'POSTGRES_PASSWORD=gitea'
|
||||||
|
- 'POSTGRES_DB=gitea'
|
||||||
|
volumes:
|
||||||
|
- 'db-data:/var/lib/postgresql/data'
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
public:
|
public:
|
||||||
external: true
|
external: true
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
data:
|
data:
|
||||||
|
|
Loading…
Reference in New Issue