Skip to content

Instantly share code, notes, and snippets.

@aliyeysides
Last active September 3, 2023 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aliyeysides/11bcef60e1436b9952215f0d3862ad7c to your computer and use it in GitHub Desktop.
Save aliyeysides/11bcef60e1436b9952215f0d3862ad7c to your computer and use it in GitHub Desktop.
create local postgres database with docker compose file
# run `docker-compose up -d` to start
# verify with `docker ps` or `lsof -i :5432`
services:
db:
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
image: postgres:latest
ports:
- "5432:5432"
restart: always
volumes:
- ./postgres-data:/var/lib/postgresql/data
version: "3.7"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment