Files
homelab/stacks/postgres/docker-compose.yaml
2026-04-02 19:11:18 +02:00

46 lines
1.1 KiB
YAML

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
- mattermost_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
mattermost_postgres_password:
environment: MATTERMOST_POSTGRES_PASSWORD