Last active
September 3, 2023 16:42
-
-
Save aliyeysides/11bcef60e1436b9952215f0d3862ad7c to your computer and use it in GitHub Desktop.
create local postgres database with docker compose file
This file contains 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
# 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