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,29 +1,13 @@
{% import 'macro/postgres.j2' as pg with context %}
---
version: '3.9'
services:
postgres:
image: postgres:15
restart: always
environment:
- "POSTGRES_DB={{ auth.db.name }}"
- "POSTGRES_USER={{ auth.db.user }}"
- "POSTGRES_PASSWORD={{ auth.db.password }}"
volumes:
- pg_data:/var/lib/postgresql/data
networks:
- backend
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-U", "{{ auth.db.user }}"]
interval: 10s
timeout: 5s
retries: 5
keycloak:
image: registry.tobiasmanske.de/keycloak:main
command: start
depends_on:
postgres:
pg:
condition: service_healthy
environment:
- "KC_DB=postgres"
@ -46,7 +30,11 @@ services:
- backend
- default # keycloak needs to talk to social logins
{{ pg.postgres("pg", auth.db.user, auth.db.password, auth.db.name, ["backend"]) }}
networks:
postgres:
internal: true
backend:
internal: true