Haiti-Distributed-Healthcare-System / hdhs

Haiti Distributed Healthcare System
3 stars 0 forks source link

Working docker compose with PostgreSQL, using mounted volumes, need t… #38

Closed zainakh closed 4 years ago

zainakh commented 4 years ago

To run the Postgres container, first run: $ docker-compose up

Then, to enter the Postgres shell, run the following commands in a new shell (while the compose up is active) with the credentials in the env file that I sent out (username=user though).

$ docker-compose run database bash 
# drop into the container shell
database# psql --host=database --username=user --dbname=*
Password for user user: *
meghanmc commented 4 years ago

Added mapping to expose the psql connection to the default psql port, 5432. This will be useful when using a database IDE like DataGrip.

meghanmc commented 4 years ago

Checkeddocker-compose up, docker-compose run database bash, and database commands within the shell. Verified that data persists after container is stopped. Also added the exposed db port and tested that created tables show up via the connection.