#!/bin/sh set -e # Create the dynamic config directory in the shared volume. mkdir -p {{ .Traefik.SharedMountPoint }}/dynamic chgrp {{ .FlowGID }} {{ .Traefik.SharedMountPoint }}/dynamic chmod a-rwx,u+rwx,g+rwx {{ .Traefik.SharedMountPoint }}/dynamic # Move the dashboard config to the new directory. if [ -f /tmp/dynamic_dashboard.yaml ]; then mv /tmp/dynamic_dashboard.yaml {{ .Traefik.SharedMountPoint }}/dynamic/dynamic_dashboard.yaml fi # first arg is `-f` or `--some-option` if [ "${1#-}" != "$1" ]; then set -- traefik "$@" fi # if our command is a valid Traefik subcommand, let's invoke it through Traefik instead # (this allows for "docker run traefik version", etc) if traefik "$1" --help >/dev/null 2>&1 then set -- traefik "$@" else echo "= '$1' is not a Traefik command: assuming shell execution." 1>&2 fi exec "$@"