From e0731c5656f228d6b96fd474ee1f408bd648339b Mon Sep 17 00:00:00 2001 From: Sumesh Kariyil Date: Tue, 25 Apr 2023 12:24:52 -0700 Subject: [PATCH] Adding DB_PORT to keycloak and changes to network --- docker-compose/analytics-docker-compose.yml | 31 +++++++++++++-- docker-compose/docker-compose-arm64.yml | 44 ++++++++++++++++----- docker-compose/docker-compose.yml | 44 ++++++++++++++++----- scripts/install.bash | 14 +++---- scripts/install.bat | 14 +++---- scripts/uninstall.bash | 4 +- scripts/uninstall.bat | 4 +- 7 files changed, 114 insertions(+), 41 deletions(-) diff --git a/docker-compose/analytics-docker-compose.yml b/docker-compose/analytics-docker-compose.yml index cb2d51b..6c6dd7f 100644 --- a/docker-compose/analytics-docker-compose.yml +++ b/docker-compose/analytics-docker-compose.yml @@ -4,8 +4,8 @@ version: "3.7" x-redash-service: &redash-service image: formsflow/redash:10.1.4 depends_on: - - postgres - - redis + - postgres + - redis env_file: .env restart: always @@ -18,17 +18,29 @@ services: environment: REDASH_WEB_WORKERS: 4 REDASH_MULTI_ORG: ${REDASH_MULTI_ORG:-false} + networks: + - formsflow + scheduler: <<: *redash-service command: scheduler depends_on: - server + networks: + - formsflow + scheduled_worker: <<: *redash-service command: worker + networks: + - formsflow + adhoc_worker: <<: *redash-service command: worker + networks: + - formsflow + worker: <<: *redash-service command: worker @@ -37,9 +49,15 @@ services: WORKERS_COUNT: 1 depends_on: - server + networks: + - formsflow + redis: image: redis:6-alpine restart: always + networks: + - formsflow + postgres: image: postgres:9.6-alpine ports: @@ -47,7 +65,9 @@ services: restart: always env_file: .env volumes: - - ./postgres/analytics:/var/lib/postgresql/data + - ./postgres/analytics:/var/lib/postgresql/data 777 + networks: + - formsflow # Uncomment the following to enable redash mail server # email: # image: djfarrelly/maildev @@ -55,3 +75,8 @@ services: # - "1080:80" # restart: unless-stopped +volumes: + postgres: +networks: + formsflow: + driver: bridge diff --git a/docker-compose/docker-compose-arm64.yml b/docker-compose/docker-compose-arm64.yml index 42b1981..10883f3 100644 --- a/docker-compose/docker-compose-arm64.yml +++ b/docker-compose/docker-compose-arm64.yml @@ -4,21 +4,25 @@ services: keycloak-db: image: postgres:14 volumes: - - ./postgres/keycloak:/var/lib/postgresql/data + - ./postgres/keycloak:/var/lib/postgresql/data 777 environment: POSTGRES_DB: ${KEYCLOAK_JDBC_DB:-keycloak} POSTGRES_USER: ${KEYCLOAK_JDBC_USER:-admin} POSTGRES_PASSWORD: ${KEYCLOAK_JDBC_PASSWORD:-changeme} - + PGDATA: /var/lib/postgresql/data + networks: + - formsflow + keycloak: image: formsflow/forms-flow-keycloak-arm64:14.0.0 volumes: - ./configuration/imports:/opt/jboss/keycloak/imports - command: + command: - "-b 0.0.0.0 -Dkeycloak.import=/opt/jboss/keycloak/imports/formsflow-ai-realm.json -Dkeycloak.migration.strategy=OVERWRITE_EXISTING" environment: - DB_VENDOR=POSTGRES - DB_ADDR=keycloak-db + - DB_PORT=5432 - DB_DATABASE=${KEYCLOAK_JDBC_DB:-keycloak} - DB_USER=${KEYCLOAK_JDBC_USER-admin} - DB_PASSWORD=${KEYCLOAK_JDBC_PASSWORD:-changeme} @@ -28,8 +32,9 @@ services: - "8080:8080" links: - keycloak-db - - + networks: + - formsflow + forms-flow-forms-db: image: mongo:5.0 restart: always @@ -44,7 +49,9 @@ services: - ./mongodb/mongod.conf:/etc/mongod.conf ports: - "27018:27017" - + networks: + - formsflow + forms-flow-web: image: formsflow/forms-flow-web:v5.1.0 volumes: @@ -54,6 +61,8 @@ services: - keycloak ports: - "3000:8080" + networks: + - formsflow forms-flow-forms: image: formsflow/forms-flow-forms:v5.1.0 @@ -70,7 +79,9 @@ services: - "3001:3001" links: - forms-flow-forms-db - + networks: + - formsflow + forms-flow-bpm-db: image: postgres:14 environment: @@ -81,6 +92,8 @@ services: - ./postgres/camunda:/var/lib/postgresql/data 777 ports: - "5432:5432" + networks: + - formsflow forms-flow-bpm: image: formsflow/forms-flow-bpm:v5.1.0-arm64 @@ -120,7 +133,9 @@ services: links: - forms-flow-bpm-db - keycloak - + networks: + - formsflow + forms-flow-webapi-db: image: postgres:14 restart: always @@ -132,6 +147,8 @@ services: - ./postgres/webapi:/var/lib/postgresql/data 777 ports: - "6432:5432" + networks: + - formsflow forms-flow-webapi: image: formsflow/forms-flow-webapi:v5.1.0 @@ -172,7 +189,9 @@ services: FORMIO_JWT_SECRET: ${FORMIO_JWT_SECRET:---- change me now ---} ports: - "5001:5000" - + networks: + - formsflow + proxy: image: nginx:stable-alpine volumes: @@ -185,7 +204,12 @@ services: - forms-flow-forms ports: - "8081:8081" - + networks: + - formsflow volumes: postgres: + mongodb: +networks: + formsflow: + driver: bridge diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index 3081fcf..ae7beee 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -4,21 +4,25 @@ services: keycloak-db: image: postgres:14 volumes: - - ./postgres/keycloak:/var/lib/postgresql/data + - ./postgres/keycloak:/var/lib/postgresql/data 777 environment: POSTGRES_DB: ${KEYCLOAK_JDBC_DB:-keycloak} POSTGRES_USER: ${KEYCLOAK_JDBC_USER:-admin} POSTGRES_PASSWORD: ${KEYCLOAK_JDBC_PASSWORD:-changeme} - + PGDATA: /var/lib/postgresql/data + networks: + - formsflow + keycloak: image: quay.io/keycloak/keycloak:14.0.0 volumes: - ./configuration/imports:/opt/jboss/keycloak/imports - command: + command: - "-b 0.0.0.0 -Dkeycloak.import=/opt/jboss/keycloak/imports/formsflow-ai-realm.json -Dkeycloak.migration.strategy=OVERWRITE_EXISTING" environment: - DB_VENDOR=POSTGRES - DB_ADDR=keycloak-db + - DB_PORT=5432 - DB_DATABASE=${KEYCLOAK_JDBC_DB:-keycloak} - DB_USER=${KEYCLOAK_JDBC_USER-admin} - DB_PASSWORD=${KEYCLOAK_JDBC_PASSWORD:-changeme} @@ -28,8 +32,9 @@ services: - "8080:8080" links: - keycloak-db - - + networks: + - formsflow + forms-flow-forms-db: image: mongo:5.0 restart: always @@ -44,7 +49,9 @@ services: - ./mongodb/mongod.conf:/etc/mongod.conf ports: - "27018:27017" - + networks: + - formsflow + forms-flow-web: image: formsflow/forms-flow-web:v5.1.0 volumes: @@ -53,6 +60,8 @@ services: - forms-flow-webapi ports: - "3000:8080" + networks: + - formsflow forms-flow-forms: image: formsflow/forms-flow-forms:v5.1.0 @@ -69,7 +78,9 @@ services: - "3001:3001" links: - forms-flow-forms-db - + networks: + - formsflow + forms-flow-bpm-db: image: postgres:14 environment: @@ -80,6 +91,8 @@ services: - ./postgres/camunda:/var/lib/postgresql/data 777 ports: - "5432:5432" + networks: + - formsflow forms-flow-bpm: image: formsflow/forms-flow-bpm:v5.1.0 @@ -119,7 +132,9 @@ services: links: - forms-flow-bpm-db - keycloak - + networks: + - formsflow + forms-flow-webapi-db: image: postgres:14 restart: always @@ -131,6 +146,8 @@ services: - ./postgres/webapi:/var/lib/postgresql/data 777 ports: - "6432:5432" + networks: + - formsflow forms-flow-webapi: image: formsflow/forms-flow-webapi:v5.1.0 @@ -169,7 +186,9 @@ services: FORMIO_JWT_SECRET: ${FORMIO_JWT_SECRET:---- change me now ---} ports: - "5000:5000" - + networks: + - formsflow + proxy: image: nginx:stable-alpine volumes: @@ -182,7 +201,12 @@ services: - forms-flow-forms ports: - "8081:8081" - + networks: + - formsflow volumes: postgres: + mongodb: +networks: + formsflow: + driver: bridge diff --git a/scripts/install.bash b/scripts/install.bash index 625db2a..2e715c0 100755 --- a/scripts/install.bash +++ b/scripts/install.bash @@ -142,8 +142,8 @@ function formsFlowAnalytics echo REDASH_REFERRER_POLICY=$REDASH_REFERRER_POLICY>>.env echo REDASH_CORS_ACCESS_CONTROL_ALLOW_HEADERS=$REDASH_CORS_ACCESS_CONTROL_ALLOW_HEADERS>>.env - docker-compose -f analytics-docker-compose.yml run --rm server create_db - docker-compose -f analytics-docker-compose.yml up --build -d + docker-compose -p formsflow-ai -f analytics-docker-compose.yml run --rm server create_db + docker-compose -p formsflow-ai -f analytics-docker-compose.yml up --build -d } ############################################################# @@ -161,7 +161,7 @@ function formsFlowBpm echo FORMSFLOW_API_URL=$FORMSFLOW_API_URL >>.env echo WEBSOCKET_SECURITY_ORIGIN=$WEBSOCKET_SECURITY_ORIGIN >> .env echo SESSION_COOKIE_SECURE=${SESSION_COOKIE_SECURE} >> .env - docker-compose -f $docker_compose_file up --build -d forms-flow-bpm + docker-compose -p formsflow-ai -f $docker_compose_file up --build -d forms-flow-bpm } ############################################################# @@ -181,7 +181,7 @@ function formsFlowApi ) fi - docker-compose -f $docker_compose_file up --build -d forms-flow-webapi + docker-compose -p formsflow-ai -f $docker_compose_file up --build -d forms-flow-webapi } ############################################################# @@ -195,13 +195,13 @@ function formsFlowForms echo FORMIO_DEFAULT_PROJECT_URL=$FORMIO_DEFAULT_PROJECT_URL>>.env - docker-compose -f $docker_compose_file up --build -d forms-flow-forms + docker-compose -p formsflow-ai -f $docker_compose_file up --build -d forms-flow-forms } function formsFlowWeb { cd ../docker-compose/ -docker-compose -f $docker_compose_file up --build -d forms-flow-web +docker-compose -p formsflow-ai -f $docker_compose_file up --build -d forms-flow-web isUp } @@ -221,7 +221,7 @@ function keycloak printf "%s " "Press enter to continue" read that echo Please wait, keycloak is setting up! - docker-compose -f $docker_compose_file up --build -d keycloak + docker-compose -p formsflow-ai -f $docker_compose_file up --build -d keycloak } } function orderwithanalytics diff --git a/scripts/install.bat b/scripts/install.bat index 45ac590..31b0873 100644 --- a/scripts/install.bat +++ b/scripts/install.bat @@ -63,7 +63,7 @@ EXIT /B %ERRORLEVEL% if exist %~1\.env ( del %~1\.env ) - docker-compose -f %~1\docker-compose.yml up --build -d keycloak + docker-compose -p formsflow-ai -f %~1\docker-compose.yml up --build -d keycloak timeout 5 set KEYCLOAK_URL=http://%ip-add%:8080 ) @@ -77,7 +77,7 @@ EXIT /B %ERRORLEVEL% set FORMIO_DEFAULT_PROJECT_URL=http://%ip-add%:3001 echo FORMIO_DEFAULT_PROJECT_URL=%FORMIO_DEFAULT_PROJECT_URL%>>%~1\.env - docker-compose -f %~1\docker-compose.yml up --build -d forms-flow-forms + docker-compose -p formsflow-ai -f %~1\docker-compose.yml up --build -d forms-flow-forms timeout 5 EXIT /B 0 @@ -127,7 +127,7 @@ EXIT /B %ERRORLEVEL% :forms-flow-web - docker-compose -f %~1\docker-compose.yml up --build -d forms-flow-web + docker-compose -p formsflow-ai -f %~1\docker-compose.yml up --build -d forms-flow-web EXIT /B 0 :: ############################################################# @@ -147,7 +147,7 @@ EXIT /B %ERRORLEVEL% echo WEBSOCKET_SECURITY_ORIGIN=%WEBSOCKET_SECURITY_ORIGIN%>>%~1\.env echo SESSION_COOKIE_SECURE=%SESSION_COOKIE_SECURE%>>%~1\.env ENDLOCAL - docker-compose -f %~1\docker-compose.yml up --build -d forms-flow-bpm + docker-compose -p formsflow-ai -f %~1\docker-compose.yml up --build -d forms-flow-bpm timeout 6 EXIT /B 0 @@ -185,8 +185,8 @@ EXIT /B %ERRORLEVEL% echo REDASH_REFERRER_POLICY=%REDASH_REFERRER_POLICY%>>%~1\.env echo REDASH_CORS_ACCESS_CONTROL_ALLOW_HEADERS=%REDASH_CORS_ACCESS_CONTROL_ALLOW_HEADERS%>>%~1\.env ENDLOCAL - docker-compose -f %~1\analytics-docker-compose.yml run --rm server create_db - docker-compose -f %~1\analytics-docker-compose.yml up --build -d + docker-compose -p formsflow-ai -f %~1\analytics-docker-compose.yml run --rm server create_db + docker-compose -p formsflow-ai -f %~1\analytics-docker-compose.yml up --build -d timeout 5 EXIT /B 0 @@ -210,6 +210,6 @@ EXIT /B %ERRORLEVEL% ) ENDLOCAL - docker-compose -f %~1\docker-compose.yml up --build -d forms-flow-webapi + docker-compose -p formsflow-ai -f %~1\docker-compose.yml up --build -d forms-flow-webapi diff --git a/scripts/uninstall.bash b/scripts/uninstall.bash index 5a01a2e..94ff840 100644 --- a/scripts/uninstall.bash +++ b/scripts/uninstall.bash @@ -8,6 +8,6 @@ echo "Do you want to uninstall formsflow.ai installation? [y/n]" read choice if [[ $choice == "y" ]]; then cd ../docker-compose - docker-compose -f analytics-docker-compose.yml down - docker-compose -f $docker_compose_file down + docker-compose -p formsflow-ai -f analytics-docker-compose.yml down + docker-compose -p formsflow-ai -f $docker_compose_file down fi diff --git a/scripts/uninstall.bat b/scripts/uninstall.bat index 8c39da8..6ace963 100644 --- a/scripts/uninstall.bat +++ b/scripts/uninstall.bat @@ -38,7 +38,7 @@ EXIT /B %ERRORLEVEL% :forms-flow-all if exist %~1 ( - docker-compose -f %~1\docker-compose.yml down + docker-compose -p formsflow-ai -f %~1\docker-compose.yml down ) EXIT /B 0 @@ -49,7 +49,7 @@ EXIT /B %ERRORLEVEL% :forms-flow-analytics if exist %~1 ( - docker-compose -f %~1\analytics-docker-compose.yml down + docker-compose -p formsflow-ai -f %~1\analytics-docker-compose.yml down ) EXIT /B 0