Skip to content

Instantly share code, notes, and snippets.

@robherley
Created September 12, 2018 23:40
Show Gist options
  • Save robherley/99d28b529bdedc280c8f231f23956a0c to your computer and use it in GitHub Desktop.
Save robherley/99d28b529bdedc280c8f231f23956a0c to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Howdy, what folder do you want to serve assets from?"
echo -n ">"
read foldrdir
echo "Okay, I'll read from $foldrdir. What do you want to name the container?"
echo -n ">"
read container
echo "The container will be named '$container'. What frontend rule do you want to use for traefik?"
echo -n ">"
read urlrule
echo "Creating container '$container' from $foldrdir mapped to $urlrule..."
docker run --name $container -v $PWD/$foldrdir:/usr/share/nginx/html:ro -d -l "traefik.enable=true" -l "traefik.backend=$container-static" -l "traefik.frontend.rule=Host:$urlrule" --network traefik_proxy nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment