Created
October 29, 2019 15:58
-
-
Save RenzoTejada/835f31994c771bd1c7eaf76881de3305 to your computer and use it in GitHub Desktop.
Docker Compose para postgresql
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" | |
services: | |
# Create a service named db. | |
db: | |
# Use the Docker Image postgres. This will pull the newest release. | |
image: "postgres" | |
# Give the container the name my_postgres. You can changes to something else. | |
container_name: "demo_uno_postgres" | |
# Setup the username, password, and database name. You can changes these values. | |
environment: | |
- POSTGRES_USER=u_demo | |
- POSTGRES_PASSWORD=pwd0123456789 | |
- POSTGRES_DB=db_demo_uno | |
# Maps port 54320 (localhost) to port 5432 on the container. You can change the ports to fix your needs. | |
ports: | |
- "5432:5432" | |
# Set a volume some that database is not lost after shutting down the container. | |
# I used the name postgres-data but you can changed it to something else. | |
volumes: | |
- ./postgres-data:/var/lib/postgresql/data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment