Skip to content

Instantly share code, notes, and snippets.

@zetxx
Created February 29, 2024 13:51
Show Gist options
  • Save zetxx/eb70a609a8a08540a233172ac74ea56e to your computer and use it in GitHub Desktop.
Save zetxx/eb70a609a8a08540a233172ac74ea56e to your computer and use it in GitHub Desktop.
version: '3.9'
services:
postgresql:
restart: unless-stopped
container_name: postgresql
hostname: postgresql
image: postgres:alpine
ports:
- '5432:5432'
volumes:
- postgresql:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: "mysecretpassword"
tty: true
stdin_open: true
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "5"
deploy:
resources:
limits:
memory: '1024M'
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgresql:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment