Created
October 11, 2022 11:52
-
-
Save ahbanavi/a1c3fb9f796e757f9b076ff13574b86b to your computer and use it in GitHub Desktop.
docker compose psql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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