Skip to content

Instantly share code, notes, and snippets.

@neibla
Created January 30, 2021 09:09
Show Gist options
  • Save neibla/9108b711d1e26f4ffc571b6e659e9722 to your computer and use it in GitHub Desktop.
Save neibla/9108b711d1e26f4ffc571b6e659e9722 to your computer and use it in GitHub Desktop.
version: "3.7"
services:
database:
image: "postgres:13.1"
environment:
POSTGRES_PASSWORD: "password"
# env_file:
# - database.env # configure postgres
volumes:
- database-data:/var/lib/postgresql/data/
# if we wanted stored on host machine:
# - ./db_data/:/var/lib/postgresql/data/
ports:
- "5432:5432"
volumes:
database-data:
# docker-compose up -d
#PGPASSWORD=password psql -h localhost -p 5432 -U postgres
# destroy data
# docker-compose down --volumes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment