From 26875f13bfbc11b1a67a92ddaf64b2a4492ba682 Mon Sep 17 00:00:00 2001 From: jasquat Date: Wed, 15 Feb 2023 17:21:37 -0500 Subject: [PATCH] updated remaining configs manually w/ burnettk --- docker-compose.yml | 14 +++++++------- spiffworkflow-backend/bin/boot_server_in_docker | 8 ++++---- spiffworkflow-backend/bin/run_server_locally | 2 +- spiffworkflow-backend/docker-compose.yml | 16 ++++++++-------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 31e348b51..e19ec4a28 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,24 +18,24 @@ services: spiffworkflow-db: condition: service_healthy environment: - APPLICATION_ROOT: "/" + SPIFFWORKFLOW_BACKEND_APPLICATION_ROOT: "/" SPIFFWORKFLOW_BACKEND_ENV: "local_development" FLASK_DEBUG: "0" FLASK_SESSION_SECRET_KEY: "${FLASK_SESSION_SECRET_KEY:-super_secret_key}" - OPEN_ID_SERVER_URL: "http://localhost:${SPIFF_BACKEND_PORT:-8000}/openid" + SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL: "http://localhost:${SPIFF_BACKEND_PORT:-8000}/openid" SPIFFWORKFLOW_FRONTEND_URL: "http://localhost:${SPIFF_FRONTEND_PORT:-8001}" # WARNING: Frontend is a static site which assumes frontend port - 1 on localhost. SPIFFWORKFLOW_BACKEND_URL: "http://localhost:${SPIFF_BACKEND_PORT:-8000}" SPIFFWORKFLOW_BACKEND_PORT: "${SPIFF_BACKEND_PORT:-8000}" SPIFFWORKFLOW_BACKEND_UPGRADE_DB: "true" SPIFFWORKFLOW_BACKEND_DATABASE_URI: "mysql+mysqlconnector://root:${SPIFF_MYSQL_PASS:-my-secret-pw}@spiffworkflow-db:${SPIFF_MYSQL_PORT:-8003}/spiffworkflow_backend_development" - BPMN_SPEC_ABSOLUTE_DIR: "/app/process_models" + SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR: "/app/process_models" SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA: "false" SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_NAME: "example.yml" - RUN_BACKGROUND_SCHEDULER: "true" - OPEN_ID_CLIENT_ID: "spiffworkflow-backend" - OPEN_ID_CLIENT_SECRET_KEY: "my_open_id_secret_key" - CONNECTOR_PROXY_URL: "http://spiffworkflow-connector:8004" + SPIFFWORKFLOW_BACKEND_RUN_BACKGROUND_SCHEDULER: "true" + SPIFFWORKFLOW_BACKEND_OPEN_ID_CLIENT_ID: "spiffworkflow-backend" + SPIFFWORKFLOW_BACKEND_OPEN_ID_CLIENT_SECRET_KEY: "my_open_id_secret_key" + SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_URL: "http://spiffworkflow-connector:8004" ports: - "${SPIFF_BACKEND_PORT:-8000}:${SPIFF_BACKEND_PORT:-8000}/tcp" volumes: diff --git a/spiffworkflow-backend/bin/boot_server_in_docker b/spiffworkflow-backend/bin/boot_server_in_docker index 4cd430a33..2976e27d8 100755 --- a/spiffworkflow-backend/bin/boot_server_in_docker +++ b/spiffworkflow-backend/bin/boot_server_in_docker @@ -10,12 +10,12 @@ set -o errtrace -o errexit -o nounset -o pipefail # run migrations export FLASK_APP=/app/src/spiffworkflow_backend -if [[ "${WAIT_FOR_DB_TO_BE_READY:-}" == "true" ]]; then +if [[ "${SPIFFWORKFLOW_BACKEND_WAIT_FOR_DB_TO_BE_READY:-}" == "true" ]]; then echo 'Waiting for db to be ready...' poetry run python ./bin/wait_for_db_to_be_ready.py fi -if [[ "${DOWNGRADE_DB:-}" == "true" ]]; then +if [[ "${SPIFFWORKFLOW_BACKEND_DOWNGRADE_DB:-}" == "true" ]]; then echo 'Downgrading database...' poetry run flask db downgrade fi @@ -40,8 +40,8 @@ fi additional_args="" -if [[ "${APPLICATION_ROOT:-}" != "/" ]]; then - additional_args="${additional_args} -e SCRIPT_NAME=${APPLICATION_ROOT}" +if [[ "${SPIFFWORKFLOW_BACKEND_APPLICATION_ROOT:-}" != "/" ]]; then + additional_args="${additional_args} -e SCRIPT_NAME=${SPIFFWORKFLOW_BACKEND_APPLICATION_ROOT}" fi # HACK: if loading fixtures for acceptance tests when we do not need multiple workers diff --git a/spiffworkflow-backend/bin/run_server_locally b/spiffworkflow-backend/bin/run_server_locally index 2a4f50341..d27ddf3b0 100755 --- a/spiffworkflow-backend/bin/run_server_locally +++ b/spiffworkflow-backend/bin/run_server_locally @@ -21,7 +21,7 @@ SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR=$(./bin/find_sample_process_models) export SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR export FLASK_SESSION_SECRET_KEY=super_secret_key -export APPLICATION_ROOT="/" +export SPIFFWORKFLOW_BACKEND_APPLICATION_ROOT="/" if [[ -n "${SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA:-}" ]]; then ./bin/boot_server_in_docker diff --git a/spiffworkflow-backend/docker-compose.yml b/spiffworkflow-backend/docker-compose.yml index b1847ef6e..43cfd9601 100644 --- a/spiffworkflow-backend/docker-compose.yml +++ b/spiffworkflow-backend/docker-compose.yml @@ -50,20 +50,20 @@ services: build: context: . environment: - - APPLICATION_ROOT=/ - - SPIFFWORKFLOW_BACKEND_ENV=${SPIFFWORKFLOW_BACKEND_ENV:-local_development} - FLASK_DEBUG=0 - FLASK_SESSION_SECRET_KEY=${FLASK_SESSION_SECRET_KEY:-super_secret_key} - - SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL=${SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL:-http://localhost:7002/realms/spiffworkflow} - - SPIFFWORKFLOW_BACKEND_SPIFFWORKFLOW_FRONTEND_URL=${SPIFFWORKFLOW_BACKEND_SPIFFWORKFLOW_FRONTEND_URL:-http://localhost:7001} - - SPIFFWORKFLOW_BACKEND_URL=${SPIFFWORKFLOW_BACKEND_URL:-http://localhost:7000} - - SPIFFWORKFLOW_BACKEND_PORT=7000 - - SPIFFWORKFLOW_BACKEND_UPGRADE_DB=true - - SPIFFWORKFLOW_BACKEND_DATABASE_URI=mysql+mysqlconnector://root:${SPIFFWORKFLOW_BACKEND_MYSQL_ROOT_DATABASE:-my-secret-pw}@localhost:7003/${SPIFFWORKFLOW_BACKEND_DATABASE_NAME:-spiffworkflow_backend_development} + - SPIFFWORKFLOW_BACKEND_APPLICATION_ROOT=/ - SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR=/app/process_models + - SPIFFWORKFLOW_BACKEND_DATABASE_URI=mysql+mysqlconnector://root:${SPIFFWORKFLOW_BACKEND_MYSQL_ROOT_DATABASE:-my-secret-pw}@localhost:7003/${SPIFFWORKFLOW_BACKEND_DATABASE_NAME:-spiffworkflow_backend_development} + - SPIFFWORKFLOW_BACKEND_ENV=${SPIFFWORKFLOW_BACKEND_ENV:-local_development} - SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA=${SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA:-false} + - SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL=${SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL:-http://localhost:7002/realms/spiffworkflow} - SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_NAME=${SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_NAME:-acceptance_tests.yml} + - SPIFFWORKFLOW_BACKEND_PORT=7000 - SPIFFWORKFLOW_BACKEND_RUN_BACKGROUND_SCHEDULER=true + - SPIFFWORKFLOW_BACKEND_SPIFFWORKFLOW_FRONTEND_URL=${SPIFFWORKFLOW_BACKEND_SPIFFWORKFLOW_FRONTEND_URL:-http://localhost:7001} + - SPIFFWORKFLOW_BACKEND_UPGRADE_DB=true + - SPIFFWORKFLOW_BACKEND_URL=${SPIFFWORKFLOW_BACKEND_URL:-http://localhost:7000} ports: - "7000:7000" network_mode: host