Commit 0fa0c367 authored by Jürgen Haas's avatar Jürgen Haas
Browse files

l3d#90 Adjust node_cmd script to work with Traefik 2

parent b51cf891
Pipeline #35014 passed with stage
in 46 seconds
......@@ -8,6 +8,21 @@ ID=$(docker container ls --all -q -f name=^${NAME}$)
if [[ -n ${ID} ]]; then
docker start ${NAME} >/dev/null
else
if [[ "$DOCKER4DRUPAL_TRAEFIK_USESSL" == "1" ]]; then
SCHEMA=https
if [[ "$DOCKER4DRUPAL_TRAEFIK_PORTS" == "443" ]]; then
PORT=
else
PORT=":$DOCKER4DRUPAL_TRAEFIK_PORTS"
fi
else
SCHEMA=http
if [[ "$DOCKER4DRUPAL_TRAEFIK_PORT" == "80" ]]; then
PORT=
else
PORT=":$DOCKER4DRUPAL_TRAEFIK_PORT"
fi
fi
docker run --init -itd --name=${NAME} \
--network traefik_${COMPOSE_PROJECT_NAME} \
--network-alias bs \
......@@ -16,10 +31,9 @@ else
--label traefik.http.services.${COMPOSE_PROJECT_NAME}_bs.loadbalancer.server.port=3000 \
--label traefik.http.routers.${COMPOSE_PROJECT_NAME}_bs.rule=Host\(\`bs-${COMPOSE_PROJECT_NAME}.${DOCKER4DRUPAL_TRAEFIK_DOMAIN}\`\) \
--env COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME} \
--env DOCKER4DRUPAL_TRAEFIK_PORT=${DOCKER4DRUPAL_TRAEFIK_PORT} \
--env DOCKER4DRUPAL_TRAEFIK_PORTS=${DOCKER4DRUPAL_TRAEFIK_PORTS} \
--env DOCKER4DRUPAL_TRAEFIK_USESSL=${DOCKER4DRUPAL_TRAEFIK_USESSL} \
--env DOCKER4DRUPAL_TRAEFIK_DOMAIN=${DOCKER4DRUPAL_TRAEFIK_DOMAIN} \
--env DOCKER4DRUPAL_NODE_DOMAIN=${COMPOSE_PROJECT_NAME}.${DOCKER4DRUPAL_TRAEFIK_DOMAIN} \
--env DOCKER4DRUPAL_NODE_PORT=${PORT} \
--env DOCKER4DRUPAL_NODE_SCHEMA=${SCHEMA} \
--expose 3000 \
-v $(php /usr/local/bin/volume.php) \
-w ${PWD} \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment