Skip to content

Instantly share code, notes, and snippets.

@daveenguyen
Created October 19, 2015 09:23
Show Gist options
  • Save daveenguyen/e67eee248bf3e045892b to your computer and use it in GitHub Desktop.
Save daveenguyen/e67eee248bf3e045892b to your computer and use it in GitHub Desktop.
Script to start each folder in the current directory as an nginx hosted static site. The virtual host will be [folder's name].example.com. Just modify the script to match your need.
#!/bin/bash
for d in */; do
docker run \
-v ${PWD}/${d}:/usr/share/nginx/html:ro \
-e VIRTUAL_HOST=${d::-1}.example.com \
-d nginx
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment