Forked from dexalex84/gist:132a4833fae76a202544ddace912ddb2
Created
January 23, 2019 04:59
-
-
Save gblok/ec48dcdea14d1d0f27e843efa80d90fe to your computer and use it in GitHub Desktop.
Creating postgresql container via docker-compose
This file contains hidden or 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
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