Skip to content

Instantly share code, notes, and snippets.

@dexalex84
Last active January 23, 2019 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dexalex84/132a4833fae76a202544ddace912ddb2 to your computer and use it in GitHub Desktop.
Save dexalex84/132a4833fae76a202544ddace912ddb2 to your computer and use it in GitHub Desktop.
Creating postgresql container via docker-compose
create folder
1)
mkdir docker-compose-pg
cd docker-compose-pg
2)
vi docker-compose.yml
insert this text:
"
postgredb:
restart: always
image: postgres:latest
ports:
- "5432:5432"
environment:
- DEBUG=false
- DB_USER=
- DB_PASS=
- DB_NAME=
- DB_TEMPLATE=
- DB_EXTENSION=
- REPLICATION_MODE=
- REPLICATION_USER=
- REPLICATION_PASS=
- REPLICATION_SSLMODE=
"
:wq - SAVE IT
3) run container
docker-compose up
creates pg service accessible from outer network by port 50000
docker-compose down - destroy this service/continer
docker-compose stop - stop container
docker-compose start - start container. All data stored from previos start still exists!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment