Updates e2e docker setup. Removes unnecessary flask and db config files.

This commit is contained in:
Aaron Louie 2020-05-22 10:15:15 -04:00
parent bc9c234903
commit bb2238f259
4 changed files with 3 additions and 55 deletions

View File

@ -2,11 +2,9 @@ version: "3.3"
services:
db:
container_name: db
image: postgres
volumes:
- ./pg-init-scripts/initdb.sh:/docker-entrypoint-initdb.d/initdb.sh
image: sartography/cr-connect-db:$E2E_TAG
ports:
- "5432"
- "5432:5432"
environment:
- POSTGRES_USER=crc_user
- POSTGRES_PASSWORD=crc_pass
@ -21,12 +19,11 @@ services:
depends_on:
- db
image: sartography/cr-connect-workflow:$E2E_TAG
volumes:
- ./flask-config/config.py:/crc-workflow/instance/config.py
environment:
- FLASK_APP=./crc/__init__.py
- RESET_DB=true
- LDAP_URL=ldap
- DB_HOST=db
ports:
- "5000:5000"
command: ./wait-for-it.sh db:5432 -t 0 -- ./docker_run.sh
@ -34,8 +31,6 @@ services:
pb:
container_name: pb
image: sartography/protocol-builder-mock:$E2E_TAG
volumes:
- ./flask-config/config_pb.py:/protocol-builder-mock/instance/config.py
environment:
- FLASK_APP=/protocol-builder-mock/app.py
ports:

View File

@ -1,14 +0,0 @@
import os
basedir = os.path.abspath(os.path.dirname(__file__))
NAME = "CR Connect Workflow"
DEVELOPMENT = True
SQLALCHEMY_DATABASE_URI = "postgresql://crc_user:crc_pass@db:5432/crc_dev"
# %s/%i placeholders expected for uva_id and study_id in various calls.
PB_USER_STUDIES_URL = "http://pb:5001/pb/user_studies?uva_id=%s"
PB_INVESTIGATORS_URL = "http://pb:5001/pb/investigators?studyid=%i"
PB_REQUIRED_DOCS_URL = "http://pb:5001/pb/required_docs?studyid=%i"
PB_STUDY_DETAILS_URL = "http://pb:5001/pb/study?studyid=%i"
print('\n\n*** USING INSTANCE CONFIG ***\n\n')

View File

@ -1,11 +0,0 @@
import os
basedir = os.path.abspath(os.path.dirname(__file__))
NAME = "CR Connect Protocol Builder Mock"
CORS_ENABLED = False
DEVELOPMENT = True
TESTING = True
SQLALCHEMY_DATABASE_URI = "postgresql://crc_user:crc_pass@db:5432/pb_test"
SECRET_KEY = 'a really really really really long secret key'
print('\n\n*** USING INSTANCE CONFIG ***\n\n')

View File

@ -1,22 +0,0 @@
#!/bin/bash
set -e
set -u
function create_user_and_database() {
local database=$1
echo " Creating user and database '$database'"
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE USER $database;
CREATE DATABASE $database;
GRANT ALL PRIVILEGES ON DATABASE $database TO $database;
EOSQL
}
if [ -n "$POSTGRES_MULTIPLE_DATABASES" ]; then
echo "Multiple database creation requested: $POSTGRES_MULTIPLE_DATABASES"
for db in $(echo $POSTGRES_MULTIPLE_DATABASES | tr ',' ' '); do
create_user_and_database $db
done
echo "Multiple databases created"
fi