Name: cpro-common
Owner: University of Washington Clinical Informatics Research Group
Description: null
Created: 2018-03-20 14:12:32.0
Updated: 2018-03-20 21:28:46.0
Pushed: 2018-03-21 22:02:42.0
Homepage: null
Size: 5340
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
(see https://docs.docker.com/compose/gettingstarted/)
Install Docker and Docker compose.
Clone project into desired working directory:
clone https://github.com/uwcirg/cpro-common.git
Build and run the containers
pro-common
er-compose build
er-compose up -d
Navigate to http://localhost:5000/hello. You should get an Welcome to CPro!
message.
The database is created using the initdb.sql
file in the /db/sql/
directory. The database container uses the volume cpro-common-db
for database data. It also maps a
2nd volume for initializing the database, which only happens if the main volume does not exist yet (I think).
The database container also exposes the mysql port (3306) as port 6603 externally.
To (1) re-create the db, (2) re-load it with data from initdb.sql, and (3) connect to it from the host machine (command-line mysql client or workbench):
pro-common
er-compose down -v
er-compose up -d --build db
l -u root -p root -h localhost -P 6603
docker-compose down
removes all related volumes, networks, and containers, so we start at a clean slate.
docker-compose up -d --build db
builds and starts only the db container.
Common commands:
project_dir>
-build and re-start containers, including db init:
er-compose down -v
er-compose up -d --build
ndows-specific: Ensures container is notified of changes by Host inside volume
n this command in PowerShell
e: https://github.com/merofeev/docker-windows-volume-watcher
t-Process -NoNewWindow docker-volume-watcher mysite
art interactive shell connected to dev container
er exec -it cpro-common-app bash
n flask shell inside interactive shell
ask shell