Skip to content

Commit

Permalink
Updated docker scripts & loadbalancer config (#81)
Browse files Browse the repository at this point in the history
* docker: added more params to wait script

* docker: added rest app with load balancer config

* docker: made docker start script more intelligent

* docker: added wait script to all ui configs to ensure proper initialization

* docker: updated docker start scripts

* docker: updated docker configs

* docker: added stop and remove all flowable containers script

* Flowable REST: changed default container port: 8080
  • Loading branch information
yvoswillens authored and tijsrademakers committed Dec 15, 2016
1 parent cd30302 commit 65c1c0d
Show file tree
Hide file tree
Showing 42 changed files with 499 additions and 99 deletions.
36 changes: 36 additions & 0 deletions docker/admin-idm-postgres.sh
@@ -0,0 +1,36 @@
#!/bin/bash
DOCKER_COMPOSE_FILE="../modules/flowable-ui-admin/src/main/docker/app.yml"

if [ -z "$1" ]
then
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} info"
exit 1
fi

if [ $1 == start ]
then
docker-compose -f $DOCKER_COMPOSE_FILE up -d
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers starting in background \nFor log info: ${0##*/} info"
else
echo -e "\nFailed starting containers"
fi
elif [ $1 == stop ]
then
docker-compose -f $DOCKER_COMPOSE_FILE down
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers successfully stopped"
else
echo -e "\nFailed stopping containers"
fi
elif [ $1 == info ]
then
docker-compose -f $DOCKER_COMPOSE_FILE logs --follow
else
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} info"
exit 1
fi
30 changes: 30 additions & 0 deletions docker/config/loadbalancer-rest-postgres.yml
@@ -0,0 +1,30 @@
version: '2'
services:
flowable-rest-app:
image: flowable/flowable-rest
depends_on:
- flowable-db
environment:
- datasource.driver=org.postgresql.Driver
- datasource.url=jdbc:postgresql://flowable-db:5432/flowable
- datasource.username=flowable
- datasource.password=flowable
- rest.docs.swagger.enabled=false
expose:
- "9977"
entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "java", "-jar", "flowable-rest.jar", "-httpPort=9977", "-httpProtocol=org.apache.coyote.http11.Http11NioProtocol"]
flowable-db:
extends:
file: postgres.yml
service: flowable-postgres
flowable-lb:
image: dockercloud/haproxy
links:
- flowable-rest-app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- STATS_AUTH=flowable:flowable
ports:
- 8080:80
- 8081:1936
4 changes: 4 additions & 0 deletions docker/config/modeler-task-idm-admin-postgres.yml
Expand Up @@ -19,6 +19,7 @@ services:
- deployment.api.url=http://flowable-task-app:9999/flowable-task/process-api
ports:
- 8888:8888
entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "java", "-jar", "flowable-modeler.jar", "-httpPort=8888", "-httpProtocol=org.apache.coyote.http11.Http11NioProtocol"]
flowable-task-app:
image: flowable/flowable-task
container_name: flowable-task
Expand All @@ -36,6 +37,7 @@ services:
- idm.admin.password=test
ports:
- 9999:9999
entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "java", "-jar", "flowable-task.jar", "-httpPort=9999", "-httpProtocol=org.apache.coyote.http11.Http11NioProtocol"]
flowable-idm-app:
image: flowable/flowable-idm
container_name: flowable-idm
Expand All @@ -48,6 +50,7 @@ services:
- datasource.password=flowable
ports:
- 8080:8080
entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "java", "-jar", "flowable-idm.jar", "-httpPort=8080", "-httpProtocol=org.apache.coyote.http11.Http11NioProtocol"]
flowable-admin-app:
image: flowable/flowable-admin
container_name: flowable-admin
Expand Down Expand Up @@ -82,6 +85,7 @@ services:
- rest.content.app.restroot=content-api
ports:
- 9988:9988
entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "java", "-jar", "flowable-admin.jar", "-httpPort=9988", "-httpProtocol=org.apache.coyote.http11.Http11NioProtocol"]
flowable-db:
extends:
file: postgres.yml
Expand Down
4 changes: 3 additions & 1 deletion docker/config/rest-idm-admin-postgres.yml
Expand Up @@ -13,7 +13,7 @@ services:
- 9977:9977
depends_on:
- flowable-db
entrypoint: ["./wait-for-postgres.sh", "flowable-db", "java", "-jar", "flowable-rest.jar", "-httpPort=9977", "-httpProtocol=org.apache.coyote.http11.Http11NioProtocol"]
entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "java", "-jar", "flowable-rest.jar", "-httpPort=9977", "-httpProtocol=org.apache.coyote.http11.Http11NioProtocol"]
flowable-admin-app:
image: flowable/flowable-admin
depends_on:
Expand Down Expand Up @@ -47,6 +47,7 @@ services:
- rest.content.app.restroot=content-api
ports:
- 9988:9988
entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "java", "-jar", "flowable-admin.jar", "-httpPort=9988", "-httpProtocol=org.apache.coyote.http11.Http11NioProtocol"]
flowable-idm-app:
image: flowable/flowable-idm
depends_on:
Expand All @@ -58,6 +59,7 @@ services:
- datasource.password=flowable
ports:
- 8080:8080
entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "java", "-jar", "flowable-idm.jar", "-httpPort=8080", "-httpProtocol=org.apache.coyote.http11.Http11NioProtocol"]
flowable-db:
extends:
file: postgres.yml
Expand Down
33 changes: 33 additions & 0 deletions docker/idm-postgres.sh
@@ -0,0 +1,33 @@
#!/bin/bash
DOCKER_COMPOSE_FILE="../modules/flowable-ui-idm/flowable-ui-idm-app/src/main/docker/app.yml"

if [ -z "$1" ]
then
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} info"
exit 1
fi

if [ $1 == start ]
then
docker-compose -f $DOCKER_COMPOSE_FILE up -d
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers starting in background \nFor log info: ${0##*/} info"
else
echo -e "\nFailed starting containers"
fi
elif [ $1 == stop ]
then
docker-compose -f $DOCKER_COMPOSE_FILE down
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers successfully stopped"
else
echo -e "\nFailed stopping containers"
fi
elif [ $1 == info ]
then
docker-compose -f $DOCKER_COMPOSE_FILE logs --follow
fi
52 changes: 52 additions & 0 deletions docker/loadbalancer-rest-postgres.sh
@@ -0,0 +1,52 @@
#!/bin/bash
DOCKER_COMPOSE_FILE="config/loadbalancer-rest-postgres.yml"

if [ -z "$1" ]
then
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} scale [number-of-instances] \n${0##*/} info \n\nHAProxy statistics on http://localhost:8081 (flowable/flowable)"
exit 1
fi

if [ $1 == start ]
then
docker-compose -f $DOCKER_COMPOSE_FILE up -d
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers starting in background \nFor log info: \n${0##*/} info"
else
echo -e "\nFailed starting containers"
fi
elif [ $1 == stop ]
then
docker-compose -f $DOCKER_COMPOSE_FILE down
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers successfully stopped"
else
echo -e "\nFailed stopping containers"
fi
elif [ $1 == info ]
then
docker-compose -f $DOCKER_COMPOSE_FILE logs --follow
elif [ $1 == scale ]
then
if [ -z "$2" ]
then
echo -e "Number of total instances missing; f.e.: \n${0##*/} scale 2"
exit 1
else
docker-compose -f $DOCKER_COMPOSE_FILE scale flowable-rest-app=$2
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nServices scaling out in background \nFor log info: \n${0##*/} info"
else
echo -e "\nFailed scaling out services"
fi
fi
else
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} info"
exit 1
fi
36 changes: 36 additions & 0 deletions docker/modeler-idm-postgres.sh
@@ -0,0 +1,36 @@
#!/bin/bash
DOCKER_COMPOSE_FILE="../modules/flowable-ui-modeler/flowable-ui-modeler-app/src/main/docker/app.yml"

if [ -z "$1" ]
then
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} info"
exit 1
fi

if [ $1 == start ]
then
docker-compose -f $DOCKER_COMPOSE_FILE up -d
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers starting in background \nFor log info: ${0##*/} info"
else
echo -e "\nFailed starting containers"
fi
elif [ $1 == stop ]
then
docker-compose -f $DOCKER_COMPOSE_FILE down
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers successfully stopped"
else
echo -e "\nFailed stopping containers"
fi
elif [ $1 == info ]
then
docker-compose -f $DOCKER_COMPOSE_FILE logs --follow
else
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} info"
exit 1
fi
36 changes: 36 additions & 0 deletions docker/modeler-task-idm-admin-postgres.sh
@@ -0,0 +1,36 @@
#!/bin/bash
DOCKER_COMPOSE_FILE="config/modeler-task-idm-admin-postgres.yml"

if [ -z "$1" ]
then
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} info"
exit 1
fi

if [ $1 == start ]
then
docker-compose -f $DOCKER_COMPOSE_FILE up -d
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers starting in background \nFor log info: ${0##*/} info"
else
echo -e "\nFailed starting containers"
fi
elif [ $1 == stop ]
then
docker-compose -f $DOCKER_COMPOSE_FILE down
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers successfully stopped"
else
echo -e "\nFailed stopping containers"
fi
elif [ $1 == info ]
then
docker-compose -f $DOCKER_COMPOSE_FILE logs --follow
else
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} info"
exit 1
fi
36 changes: 36 additions & 0 deletions docker/rest-idm-admin-postgres.sh
@@ -0,0 +1,36 @@
#!/bin/bash
DOCKER_COMPOSE_FILE="config/rest-idm-admin-postgres.yml"

if [ -z "$1" ]
then
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} info"
exit 1
fi

if [ $1 == start ]
then
docker-compose -f $DOCKER_COMPOSE_FILE up -d
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers starting in background \nFor log info: ${0##*/} info"
else
echo -e "\nFailed starting containers"
fi
elif [ $1 == stop ]
then
docker-compose -f $DOCKER_COMPOSE_FILE down
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers successfully stopped"
else
echo -e "\nFailed stopping containers"
fi
elif [ $1 == info ]
then
docker-compose -f $DOCKER_COMPOSE_FILE logs --follow
else
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} info"
exit 1
fi
36 changes: 36 additions & 0 deletions docker/rest-postgres.sh
@@ -0,0 +1,36 @@
#!/bin/bash
DOCKER_COMPOSE_FILE="../modules/flowable-app-rest/src/main/docker/app.yml"

if [ -z "$1" ]
then
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} info"
exit 1
fi

if [ $1 == start ]
then
docker-compose -f $DOCKER_COMPOSE_FILE up -d
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers starting in background \nFor log info: ${0##*/} info"
else
echo -e "\nFailed starting containers"
fi
elif [ $1 == stop ]
then
docker-compose -f $DOCKER_COMPOSE_FILE down
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo -e "\nContainers successfully stopped"
else
echo -e "\nFailed stopping containers"
fi
elif [ $1 == info ]
then
docker-compose -f $DOCKER_COMPOSE_FILE logs --follow
else
echo -e "Usage: \n${0##*/} start \n${0##*/} stop \n${0##*/} info"
exit 1
fi
2 changes: 0 additions & 2 deletions docker/start-admin-idm-postgres.sh

This file was deleted.

2 changes: 0 additions & 2 deletions docker/start-idm-postgres.sh

This file was deleted.

2 changes: 0 additions & 2 deletions docker/start-modeler-idm-postgres.sh

This file was deleted.

2 changes: 0 additions & 2 deletions docker/start-modeler-task-idm-admin-postgres.sh

This file was deleted.

2 changes: 0 additions & 2 deletions docker/start-rest-idm-admin-postgres.sh

This file was deleted.

2 changes: 0 additions & 2 deletions docker/start-rest-postgres.sh

This file was deleted.

2 changes: 0 additions & 2 deletions docker/start-task-idm-postgres.sh

This file was deleted.

2 changes: 0 additions & 2 deletions docker/stop-admin-idm-postgres.sh

This file was deleted.

2 changes: 0 additions & 2 deletions docker/stop-idm-postgres.sh

This file was deleted.

2 changes: 0 additions & 2 deletions docker/stop-modeler-idm-postgres.sh

This file was deleted.

2 changes: 0 additions & 2 deletions docker/stop-modeler-task-idm-admin-postgres.sh

This file was deleted.

File renamed without changes.
2 changes: 0 additions & 2 deletions docker/stop-rest-idm-admin-postgres.sh

This file was deleted.

2 changes: 0 additions & 2 deletions docker/stop-rest-postgres.sh

This file was deleted.

0 comments on commit 65c1c0d

Please sign in to comment.