Files
docker-compose/.templates/postgres.yml
2026-02-06 22:52:18 +05:30

23 lines
665 B
YAML

services:
db:
container_name: db
image: docker.io/library/postgres:18.1@sha256:f42fe58fa146f29072559fcb855cc2e93e2c9ab08c1cbe7c5db4973d665e3d86
restart: unless-stopped
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- PGDATA=/var/lib/postgresql/18/docker
volumes:
- ${APPDATA_PATH}//db:/var/lib/postgresql
ports:
- ${DB_PORT}:5432
networks:
- backend
healthcheck:
test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s