Skip to content

Instantly share code, notes, and snippets.

@RenzoTejada
Created October 29, 2019 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RenzoTejada/835f31994c771bd1c7eaf76881de3305 to your computer and use it in GitHub Desktop.
Save RenzoTejada/835f31994c771bd1c7eaf76881de3305 to your computer and use it in GitHub Desktop.
Docker Compose para postgresql
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