services/templates/traefik/entrypoint.sh.gotmpl
Dan Anglin 9e24f50653
fix(traefik): redirect root domain to Free Flow
Redirect requests made to the root domain to Free Flow.
2023-08-01 02:45:28 +01:00

30 lines
963 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
echo "INFO: Moving /tmp/${f} to {{ .Traefik.SharedMountPoint }}/dynamic/${f}..."
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 "$@"