-
-
Save AnthonyLzq/8c605ff93b30e296c1ad9edc2309fc49 to your computer and use it in GitHub Desktop.
Create a postgresql database using docker-compose
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
# docker | |
DB_NAME = postgresql | |
DB_USER = anthony | |
DB_PASSWORD = 14db7d47-f442-4a90-b633-2a537c8b5c13 |
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
services: | |
postgres: | |
image: postgres | |
restart: always | |
ports: | |
- 5432 | |
environment: | |
POSTGRES_DB: ${DB_NAME} | |
POSTGRES_USER: ${DB_USER} | |
POSTGRES_PASSWORD: ${DB_PASSWORD} | |
volumes: | |
- ./db:/var/lib/postgresql/data | |
# RUN USING: docker compose --env-file [dir_name] up |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment