Created
November 16, 2021 02:45
-
-
Save honghuynhit/2733d4fa93812ff73a20d5eb81ada5d6 to your computer and use it in GitHub Desktop.
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
version: '3.8' | |
services: | |
postgresql: | |
image: 'postgres:latest' | |
ports: | |
- 5432:5432 | |
environment: | |
POSTGRES_USER: username # The PostgreSQL user (useful to connect to the database) | |
POSTGRES_PASSWORD: password # The PostgreSQL password (useful to connect to the database) | |
POSTGRES_DB: default_database # The PostgreSQL default database (automatically created at first launch) | |
volumes: | |
# In this example, we share the folder `db-data` in our root repository, with the default PostgreSQL data path. | |
# It means that every time the repository is modifying the data inside | |
# of `/var/lib/postgresql/data/`, automatically the change will appear in `db-data`. | |
# You don't need to create the `db-data` folder. Docker Compose will do it for you. | |
- ./db-data/:/var/lib/postgresql/data/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment