services/templates/traefik/entrypoint.sh.gotmpl
Dan Anglin 032c080b99
fix(traefik): update Traefik deployment
- Upgrade Traefik to version 2.10.4.
- Remove the unused dashboard router and disable the dashboard.
- Remove the now unsupported pilot token.
2023-08-01 01:15:48 +01:00

29 lines
879 B
Bash

#!/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 any dynamic config to the new directory.
for f in $( find /tmp -mindepth 1 -maxdepth 1 -type f -iname '*dynamic*.yaml' -exec basename {} \; ); do
mv -f /tmp/${f} {{ .Traefik.SharedMountPoint }}/dynamic/${f}
done
# 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 "$@"