Browse Source

add microservice

master
zeus 4 years ago
parent
commit
88ea912273
  1. 22
      install/usr/share/swarmlab.io/sec/swarmlab-sec

22
install/usr/share/swarmlab.io/sec/swarmlab-sec

@ -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="microservice-nodejs" HYBRID_NETWORK="swarmlab-nodejs"
# dont edit # dont edit
IMAGE_origin="hub.swarmlab.io:5443/hybrid-nodevuejs:latest" IMAGE_origin="hub.swarmlab.io:5443/hybrid-nodevuejs:latest"
bootstrap="sec_bootstrap" bootstrap="sec_bootstrap"
@ -243,7 +243,7 @@ version: "2"
services: services:
masterservice: masterservice:
image: ${IMAGE_origin} image: $IMAGE_NAME
privileged: true privileged: true
environment: environment:
- NODENAME=${NODENAME} - NODENAME=${NODENAME}
@ -262,7 +262,7 @@ services:
workerservice: workerservice:
image: ${IMAGE_origin} image: $IMAGE_NAME
privileged: true privileged: true
environment: environment:
- NODENAME=${NODENAME} - NODENAME=${NODENAME}
@ -433,17 +433,11 @@ build_and_push_image ()
{ {
printf "\\n\\n===> BUILD IMAGE" printf "\\n\\n===> BUILD IMAGE"
printf "\\n%s\\n" "$HEADER" printf "\\n%s\\n" "$HEADER"
echo "$ docker build -t \"$REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME\" ." echo "$ docker build -t \"$IMAGE_NAME\" ."
printf "\\n" printf "\\n"
docker build -t "$REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME" . #docker build -t "$REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME" .
docker build -t "$IMAGE_NAME" .
printf "\\n"
printf "\\n\\n===> PUSH IMAGE TO REGISTRY"
printf "\\n%s\\n" "$HEADER"
echo "$ docker push \"$REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME\""
printf "\\n"
docker push "$REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME"
} }
up_master () up_master ()
@ -627,7 +621,7 @@ if [ $COMMAND_UP -eq 1 ]; then
clear_all clear_all
#up_registry # remove for microservices #up_registry # remove for microservices
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
@ -659,7 +653,7 @@ elif [ $COMMAND_RELOAD -eq 1 ]; then
create_dockerfile create_dockerfile
down_master down_master
down_workers down_workers
#build_and_push_image build_and_push_image
up_master up_master
up_workers up_workers

Loading…
Cancel
Save