diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 1562cce..9f6ccb7 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -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: diff --git a/docker/flask-config/config.py b/docker/flask-config/config.py deleted file mode 100644 index 99094c6..0000000 --- a/docker/flask-config/config.py +++ /dev/null @@ -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') diff --git a/docker/flask-config/config_pb.py b/docker/flask-config/config_pb.py deleted file mode 100644 index 20160c7..0000000 --- a/docker/flask-config/config_pb.py +++ /dev/null @@ -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') diff --git a/docker/pg-init-scripts/initdb.sh b/docker/pg-init-scripts/initdb.sh deleted file mode 100644 index aa665fa..0000000 --- a/docker/pg-init-scripts/initdb.sh +++ /dev/null @@ -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