|
@ -37,7 +37,7 @@ EOF |
|
|
# PACKAGES enabled ths with apt-get update && apt-get $APTPARAM install -y openssh-server $PACKAGES in in RUN export DEBIAN_FRONTEND=noninteractive |
|
|
# PACKAGES enabled ths with apt-get update && apt-get $APTPARAM install -y openssh-server $PACKAGES in in RUN export DEBIAN_FRONTEND=noninteractive |
|
|
APTPARAM=" --no-install-recommends " |
|
|
APTPARAM=" --no-install-recommends " |
|
|
IMAGE_local="microservice-nodejs" |
|
|
IMAGE_local="microservice-nodejs" |
|
|
HYBRID_NETWORK="swarmlab-nodejs" |
|
|
HYBRID_NETWORK="microservice-nodejs" |
|
|
# dont edit |
|
|
# dont edit |
|
|
IMAGE_origin="hub.swarmlab.io:5480/hybrid-nodevuejs:latest" |
|
|
IMAGE_origin="hub.swarmlab.io:5480/hybrid-nodevuejs:latest" |
|
|
bootstrap="sec_bootstrap" |
|
|
bootstrap="sec_bootstrap" |
|
@ -98,6 +98,12 @@ fi |
|
|
|
|
|
|
|
|
create_dockerfile () |
|
|
create_dockerfile () |
|
|
{ |
|
|
{ |
|
|
|
|
|
docker pull $IMAGE_origin << ANSWERS |
|
|
|
|
|
yes |
|
|
|
|
|
yes |
|
|
|
|
|
yes |
|
|
|
|
|
ANSWERS |
|
|
|
|
|
|
|
|
. $Wdir/ROOT_PASSWORD |
|
|
. $Wdir/ROOT_PASSWORD |
|
|
if [ -d "$Wdir/project" ]; then |
|
|
if [ -d "$Wdir/project" ]; then |
|
|
# ----------------------------------------------- |
|
|
# ----------------------------------------------- |
|
@ -172,6 +178,12 @@ fi |
|
|
|
|
|
|
|
|
create_project () |
|
|
create_project () |
|
|
{ |
|
|
{ |
|
|
|
|
|
docker pull $IMAGE_origin << ANSWERS |
|
|
|
|
|
yes |
|
|
|
|
|
yes |
|
|
|
|
|
yes |
|
|
|
|
|
ANSWERS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$Wdir" == "$HOME" ]; then |
|
|
if [ "$Wdir" == "$HOME" ]; then |
|
|
echo"" |
|
|
echo"" |
|
@ -273,6 +285,8 @@ services: |
|
|
- NET_ADMIN |
|
|
- NET_ADMIN |
|
|
user: root |
|
|
user: root |
|
|
entrypoint: ["sec_bootstrap", "role=workerservice", "sec_master_service_name=masterservice", "sec_worker_service_name=workerservice"] |
|
|
entrypoint: ["sec_bootstrap", "role=workerservice", "sec_master_service_name=masterservice", "sec_worker_service_name=workerservice"] |
|
|
|
|
|
ports: |
|
|
|
|
|
- "\${SSH_PORT}:22" |
|
|
networks: |
|
|
networks: |
|
|
- ${HYBRID_NETWORK} |
|
|
- ${HYBRID_NETWORK} |
|
|
volumes: |
|
|
volumes: |
|
@ -480,7 +494,14 @@ down_master () |
|
|
|
|
|
|
|
|
echo "$ docker-compose stop masterservice && docker-compose rm -f masterservice" |
|
|
echo "$ docker-compose stop masterservice && docker-compose rm -f masterservice" |
|
|
printf "\\n" |
|
|
printf "\\n" |
|
|
docker-compose stop masterservice && docker-compose rm -f masterservice |
|
|
# docker-compose stop masterservice && docker-compose rm -f masterservice |
|
|
|
|
|
docker-compose rm -f -s -v |
|
|
|
|
|
docker-compose up --build --remove-orphans --force-recreate -d masterservice << ANSWERS |
|
|
|
|
|
yes |
|
|
|
|
|
yes |
|
|
|
|
|
yes |
|
|
|
|
|
ANSWERS |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
down_workers () |
|
|
down_workers () |
|
@ -629,7 +650,7 @@ if [ $COMMAND_UP -eq 1 ]; then |
|
|
generate_ssh_keys |
|
|
generate_ssh_keys |
|
|
build_and_push_image # remove for microservices |
|
|
build_and_push_image # remove for microservices |
|
|
up_master |
|
|
up_master |
|
|
up_workers |
|
|
#up_workers |
|
|
|
|
|
|
|
|
prompt_ready |
|
|
prompt_ready |
|
|
show_instruction |
|
|
show_instruction |
|
@ -650,7 +671,7 @@ elif [ $COMMAND_SCALE -eq 1 ]; then |
|
|
down_master |
|
|
down_master |
|
|
down_workers |
|
|
down_workers |
|
|
up_master |
|
|
up_master |
|
|
up_workers |
|
|
#up_workers |
|
|
|
|
|
|
|
|
prompt_ready |
|
|
prompt_ready |
|
|
show_instruction |
|
|
show_instruction |
|
@ -661,7 +682,7 @@ elif [ $COMMAND_RELOAD -eq 1 ]; then |
|
|
down_workers |
|
|
down_workers |
|
|
build_and_push_image |
|
|
build_and_push_image |
|
|
up_master |
|
|
up_master |
|
|
up_workers |
|
|
#up_workers |
|
|
|
|
|
|
|
|
prompt_ready |
|
|
prompt_ready |
|
|
show_instruction |
|
|
show_instruction |
|
|