Add central postgres database

This commit is contained in:
2026-04-01 18:53:41 +02:00
parent 7687069827
commit 7aaeffddde
3 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
services:
db:
image: postgres@sha256:035b9ab53cfa147d7202b61f5f7782b939ae815b7d6bc81c96b7b42ff1fca950
container_name: postgres
restart: unless-stopped
entrypoint: ["/bin/bash", "/init/entrypoint.sh"]
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
volumes:
- postgres_data:/var/lib/postgresql
- ./init:/init:ro
networks:
- homelab_db
secrets:
- postgres_password
- authentik_postgres_password
- gitea_postgres_password
healthcheck:
interval: 30s
retries: 5
start_period: 20s
test:
- CMD-SHELL
- pg_isready -U postgres
timeout: 5s
volumes:
postgres_data:
driver: local
networks:
homelab_db:
name: homelab_db
secrets:
postgres_password:
environment: POSTGRES_PASSWORD
authentik_postgres_password:
environment: AUTHENTIK_POSTGRES_PASSWORD
gitea_postgres_password:
environment: GITEA_POSTGRES_PASSWORD