-
Robert Hostlowsky
FROM iojs:1.6.3-onbuild
# That's all.
# + using unusual runtime - here: io.js
# + automatically runs npm install on-build
# + copies additional files considering .dockerignore
PROJ=project-x
GIT_BRANCH=feature-1
IMAGE=$PROJ:$GIT_BRANCH
CONTAINER=$PROJ_$GIT_BRANCH
docker build -t $IMAGE .
docker run -d -P \
--name $NAME $IMAGE
# optionally add git_hash ...
Possible mapping schemes:
Complex? These Nginx configurations should be generated and deleted automatically!
Jason Wilder created a simple tool for automatic Nginx proxy configuration:
docker run -d -p 80:80 \
-v /var/run/docker.sock:/tmp/docker.sock \
-t jwilder/nginx-proxy
Built-in Nginx, listens to docker events, uses docker-gen with host-based-rules templating
docker run -P d -name project:branchName \
-e VIRTUAL_HOST=project-branchName.dev-stage
project:branchName
curl http://project-branchName.dev-stage/index.html
Nginx gets automatically configured on start and stop.