Skip to content

Instantly share code, notes, and snippets.

@jgworks
Last active December 21, 2016 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgworks/f07cbb950a6fe475384a3e07a8fb160e to your computer and use it in GitHub Desktop.
Save jgworks/f07cbb950a6fe475384a3e07a8fb160e to your computer and use it in GitHub Desktop.
#!/bin/bash
mkdir -p /etc/traefik/
curl -L 'https://github.com/containous/traefik/releases/download/v1.1.2/traefik' > /usr/local/sbin/traefik
chmod +x /usr/local/sbin/traefik
# curl 'https://raw.githubusercontent.com/containous/traefik/master/traefik.sample.toml' > /etc/traefik/traefik.toml
cat > /usr/lib/systemd/system/traefik.service <<EOF
[Unit]
Description=traefik http proxy
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/traefik
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/traefik --configFile=/etc/traefik/traefik.toml
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGTERM
[Install]
WantedBy=multi-user.target
EOF
systemctl enable traefik
# systemctl start traefik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment