Skip to content

Instantly share code, notes, and snippets.

@ahbanavi
Created October 11, 2022 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ahbanavi/a1c3fb9f796e757f9b076ff13574b86b to your computer and use it in GitHub Desktop.
Save ahbanavi/a1c3fb9f796e757f9b076ff13574b86b to your computer and use it in GitHub Desktop.
docker compose psql
version: "3.3"
services:
db:
container_name: db_container
image: postgres:14-alpine3.16
restart: unless-stopped
volumes:
- db_vol:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${DB_USER:-postgres}
- POSTGRES_PASSWORD=${DB_PASS:?error:DB_PASS not set}
- POSTGRES_DB=${DB_NAME:-postgres}
ports:
- "5432:5432"
volumes:
db_vol:
driver: local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment