Postgres db macro
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2024-02-05 18:44:13 +01:00
parent f353f67150
commit e8bbb4b167
9 changed files with 86 additions and 191 deletions

View File

@ -1,23 +1,7 @@
{% import 'macro/postgres.j2' as pg with context %}
---
version: '3'
services:
database:
image: postgres:13-alpine
environment:
- POSTGRES_USER={{ hedgedoc.db.user }}
- POSTGRES_PASSWORD={{ hedgedoc.db.password }}
- POSTGRES_DB={{ hedgedoc.db.name }}
volumes:
- database:/var/lib/postgresql/data
restart: always
networks:
- backend
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-U", "{{ hedgedoc.db.user }}"]
interval: 10s
timeout: 5s
retries: 5
app:
# Make sure to use the latest release from https://hedgedoc.org/latest-release
image: quay.io/hedgedoc/hedgedoc:1.9.3
@ -63,19 +47,22 @@ services:
- "prometheus-scrape.enabled=true"
- "prometheus-scrape.port=3000"
depends_on:
database:
db:
condition: service_healthy
networks:
- backend
- metrics
- default # oauth
{{ pg.postgres("db", hedgedoc.db.user, hedgedoc.db.password, hedgedoc.db.name, ["backend"], version="13-alpine") }}
volumes:
database:
db_data:
networks:
backend:
internal: true
metrics:
external: true
postgres:
internal: true
...