Skip to content

Commit

Permalink
Merge pull request #43 from AOT-Technologies/refactor
Browse files Browse the repository at this point in the history
Adding DB_PORT to keycloak and changes to network
  • Loading branch information
sumesh-aot authored Apr 27, 2023
2 parents 62396c5 + e0731c5 commit 10b9dcf
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 41 deletions.
31 changes: 28 additions & 3 deletions docker-compose/analytics-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -37,21 +49,34 @@ 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:
- '7432:5432'
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
# ports:
# - "1080:80"
# restart: unless-stopped

volumes:
postgres:
networks:
formsflow:
driver: bridge
44 changes: 34 additions & 10 deletions docker-compose/docker-compose-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -28,8 +32,9 @@ services:
- "8080:8080"
links:
- keycloak-db


networks:
- formsflow

forms-flow-forms-db:
image: mongo:5.0
restart: always
Expand All @@ -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:
Expand All @@ -54,6 +61,8 @@ services:
- keycloak
ports:
- "3000:8080"
networks:
- formsflow

forms-flow-forms:
image: formsflow/forms-flow-forms:v5.1.0
Expand All @@ -70,7 +79,9 @@ services:
- "3001:3001"
links:
- forms-flow-forms-db

networks:
- formsflow

forms-flow-bpm-db:
image: postgres:14
environment:
Expand All @@ -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
Expand Down Expand Up @@ -120,7 +133,9 @@ services:
links:
- forms-flow-bpm-db
- keycloak

networks:
- formsflow

forms-flow-webapi-db:
image: postgres:14
restart: always
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -185,7 +204,12 @@ services:
- forms-flow-forms
ports:
- "8081:8081"

networks:
- formsflow

volumes:
postgres:
mongodb:
networks:
formsflow:
driver: bridge
44 changes: 34 additions & 10 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -28,8 +32,9 @@ services:
- "8080:8080"
links:
- keycloak-db


networks:
- formsflow

forms-flow-forms-db:
image: mongo:5.0
restart: always
Expand All @@ -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:
Expand All @@ -53,6 +60,8 @@ services:
- forms-flow-webapi
ports:
- "3000:8080"
networks:
- formsflow

forms-flow-forms:
image: formsflow/forms-flow-forms:v5.1.0
Expand All @@ -69,7 +78,9 @@ services:
- "3001:3001"
links:
- forms-flow-forms-db

networks:
- formsflow

forms-flow-bpm-db:
image: postgres:14
environment:
Expand All @@ -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
Expand Down Expand Up @@ -119,7 +132,9 @@ services:
links:
- forms-flow-bpm-db
- keycloak

networks:
- formsflow

forms-flow-webapi-db:
image: postgres:14
restart: always
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -182,7 +201,12 @@ services:
- forms-flow-forms
ports:
- "8081:8081"

networks:
- formsflow

volumes:
postgres:
mongodb:
networks:
formsflow:
driver: bridge
14 changes: 7 additions & 7 deletions scripts/install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

#############################################################
Expand All @@ -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
}

#############################################################
Expand All @@ -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
}

#############################################################
Expand All @@ -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
}

Expand All @@ -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
Expand Down
Loading

0 comments on commit 10b9dcf

Please sign in to comment.