Created
June 20, 2020 17:44
-
-
Save danilogila/c0e152a2fd119cd7397e2b78082e1a78 to your computer and use it in GitHub Desktop.
Create a Postgres container with a init script. You can create your initial database tables with a init.sql file in ./data/postgres/init.sql in your project.
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" | |
services: | |
database: | |
image: postgres:9.6 | |
container_name: "postgres-db" | |
environment: | |
- POSTGRES_DB=db_name | |
- POSTGRES_USER=db_user | |
- POSTGRES_PASSWORD=db_password | |
- POSTGRES_HOST_AUTH_METHOD=trust | |
- TZ=GMT | |
volumes: | |
- ./data/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql | |
ports: | |
- 5432:5432 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment