Skip to content

Instantly share code, notes, and snippets.

@rooty
Created February 26, 2026 17:49
Show Gist options
  • Select an option

  • Save rooty/96b95b1cee62e493f28011ba056bb3a2 to your computer and use it in GitHub Desktop.

Select an option

Save rooty/96b95b1cee62e493f28011ba056bb3a2 to your computer and use it in GitHub Desktop.
postgres:
image: 'postgres:16.0'
environment:
POSTGRES_DB: dbhost
POSTGRES_USER: user
POSTGRES_PASSWORD: password
deploy:
placement:
constraints:
- node.role == manager
# ports:
# - '5432:5432'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
- 'postgres_data:/var/lib/postgresql/data'
networks:
- db-network
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment