From 7c3f47bf59508c3fe8fa3530fdfe1de0a58529ea Mon Sep 17 00:00:00 2001 From: jbirddog <100367399+jbirddog@users.noreply.github.com> Date: Thu, 25 May 2023 15:15:58 -0400 Subject: [PATCH] Editor compose (#279) --- .gitignore | 3 +- bin/run_editor | 9 ++++++ bin/stop_editor | 3 ++ bin/update_editor | 3 ++ editor.docker-compose.yml | 66 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 83 insertions(+), 1 deletion(-) create mode 100755 bin/run_editor create mode 100755 bin/stop_editor create mode 100755 bin/update_editor create mode 100644 editor.docker-compose.yml diff --git a/.gitignore b/.gitignore index 570e37592..c04d3d11f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ t .dccache version_info.json .coverage* -UNKNOWN.egg-info/ \ No newline at end of file +UNKNOWN.egg-info/ +process_models/ \ No newline at end of file diff --git a/bin/run_editor b/bin/run_editor new file mode 100755 index 000000000..bd22bfcf0 --- /dev/null +++ b/bin/run_editor @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +SPIFF_EDITOR_BPMN_SPEC_DIR=$1 \ +docker compose -f editor.docker-compose.yml up -d + +echo "" +echo "Spiff Editor is ready." +echo "" +echo "Please open ${SPIFFWORKFLOW_BACKEND_URL_FOR_FRONTEND:-http://localhost:${SPIFFWORKFLOW_FRONTEND_PORT:-8001}}" \ No newline at end of file diff --git a/bin/stop_editor b/bin/stop_editor new file mode 100755 index 000000000..f995b9cd5 --- /dev/null +++ b/bin/stop_editor @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker compose -f editor.docker-compose.yml down diff --git a/bin/update_editor b/bin/update_editor new file mode 100755 index 000000000..45b145e8f --- /dev/null +++ b/bin/update_editor @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker compose -f editor.docker-compose.yml pull diff --git a/editor.docker-compose.yml b/editor.docker-compose.yml new file mode 100644 index 000000000..9270c6866 --- /dev/null +++ b/editor.docker-compose.yml @@ -0,0 +1,66 @@ +services: + spiffworkflow-frontend: + container_name: spiffworkflow-frontend + image: ghcr.io/sartography/spiffworkflow-frontend:main-latest + depends_on: + spiffworkflow-backend: + condition: service_healthy + environment: + APPLICATION_ROOT: "/" + PORT0: "${SPIFFWORKFLOW_FRONTEND_PORT:-8001}" + ports: + - "${SPIFFWORKFLOW_FRONTEND_PORT:-8001}:${SPIFFWORKFLOW_FRONTEND_PORT:-8001}/tcp" + + spiffworkflow-backend: + container_name: spiffworkflow-backend + image: ghcr.io/sartography/spiffworkflow-backend:main-latest + environment: + SPIFFWORKFLOW_BACKEND_APPLICATION_ROOT: "/" + SPIFFWORKFLOW_BACKEND_ENV: "local_development" + FLASK_DEBUG: "0" + FLASK_SESSION_SECRET_KEY: "${FLASK_SESSION_SECRET_KEY:-super_secret_key}" + # WARNING: Frontend is a static site which assumes frontend port - 1 on localhost. + SPIFFWORKFLOW_BACKEND_URL: "http://localhost:${SPIFF_BACKEND_PORT:-8000}" + + SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR: "/app/process_models" + SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_URL: "http://spiffworkflow-connector:8004" + SPIFFWORKFLOW_BACKEND_DATABASE_TYPE: "sqlite" + SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA: "false" + SPIFFWORKFLOW_BACKEND_OPEN_ID_CLIENT_ID: "spiffworkflow-backend" + SPIFFWORKFLOW_BACKEND_OPEN_ID_CLIENT_SECRET_KEY: "my_open_id_secret_key" + SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL: "http://localhost:${SPIFF_BACKEND_PORT:-8000}/openid" + SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_NAME: "example.yml" + SPIFFWORKFLOW_BACKEND_PORT: "${SPIFF_BACKEND_PORT:-8000}" + SPIFFWORKFLOW_BACKEND_RUN_BACKGROUND_SCHEDULER: "false" + SPIFFWORKFLOW_BACKEND_UPGRADE_DB: "true" + SPIFFWORKFLOW_BACKEND_URL_FOR_FRONTEND: "http://localhost:${SPIFFWORKFLOW_FRONTEND_PORT:-8001}" + ports: + - "${SPIFF_BACKEND_PORT:-8000}:${SPIFF_BACKEND_PORT:-8000}/tcp" + volumes: + - "${SPIFF_EDITOR_BPMN_SPEC_DIR:-./process_models}:/app/process_models" + - ./log:/app/log + healthcheck: + test: "curl localhost:${SPIFF_BACKEND_PORT:-8000}/v1.0/status --fail" + interval: 10s + timeout: 5s + retries: 20 + + spiffworkflow-connector: + container_name: spiffworkflow-connector + image: ghcr.io/sartography/connector-proxy-demo:latest + environment: + FLASK_ENV: "${FLASK_ENV:-development}" + FLASK_DEBUG: "0" + FLASK_SESSION_SECRET_KEY: "${FLASK_SESSION_SECRET_KEY:-super_secret_key}" + CONNECTOR_PROXY_PORT: "${SPIFF_CONNECTOR_PORT:-8004}" + ports: + - "${SPIFF_CONNECTOR_PORT:-8004}:${SPIFF_CONNECTOR_PORT:-8004}/tcp" + healthcheck: + test: "curl localhost:${SPIFF_CONNECTOR_PORT:-8004}/liveness --fail" + interval: 10s + timeout: 5s + retries: 20 + +volumes: + spiffworkflow_backend: + driver: local