Skip to content

Instantly share code, notes, and snippets.

@dannyockilson
Created March 4, 2019 10:00
Show Gist options
  • Save dannyockilson/af48abf49a8afebc12c526e6e5c02b09 to your computer and use it in GitHub Desktop.
Save dannyockilson/af48abf49a8afebc12c526e6e5c02b09 to your computer and use it in GitHub Desktop.
Running static sites easily in docker
alias static-this='docker run --rm -v `pwd`:/usr/share/nginx/html -p 80:80 -d nginx:alpine'
function static_that() {
docker run --rm -v `pwd`/${1}:/usr/share/nginx/html -p 80:80 -d nginx:alpine
}
alias static-that='static_that'
@dannyockilson
Copy link
Author

Usage:
static-this - serves current directory via nginx docker container
static-that path/to/folder - serves specified directory via nginx docker container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment