Skip to content

Instantly share code, notes, and snippets.

@tmurphree
Last active November 12, 2020 21:00
Show Gist options
  • Save tmurphree/a623d56feb29bbc924e81076bda5be30 to your computer and use it in GitHub Desktop.
Save tmurphree/a623d56feb29bbc924e81076bda5be30 to your computer and use it in GitHub Desktop.
docker-compose file for postgres with a volume mapped to localhost
version: '3.8'
# see https://hub.docker.com/_/postgres for information on the environment variables
services:
database:
image: postgres:13.0-alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: example
POSTGRES_DB: IMGRATEFULFOR
ports:
- 5432:5432
volumes:
# syntax is 'host-path:container-path:readWriteOrReadOnly'
- '/Users/tom/Documents/database-data/im-grateful-for:/var/lib/postgresql/data:rw'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment