This repository has been archived on 2023-05-06. You can view files and clone it, but cannot push or open issues or pull requests.
helix/internal/stacks/templates/traefik/entrypoint.sh.tmpl

26 lines
751 B
Bash

#!/bin/sh
set -e
# Create the dynamic config directory in the shared volume.
mkdir -p /helix/shared/traefik/dynamic
chgrp {{ .GroupId }} /helix/shared/traefik/dynamic
chmod a-rwx,u+rwx,g+rwx /helix/shared/traefik/dynamic
# Move the dashboard config to the new directory.
mv /tmp/dynamic_dashboard.yaml /helix/shared/traefik/dynamic/dashboard.yaml
# 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 "$@"