Skip to content

Instantly share code, notes, and snippets.

@zaverden
Created May 22, 2018 06:22
Show Gist options
  • Save zaverden/1a98d8d273accf1ba02ee3138cf91c67 to your computer and use it in GitHub Desktop.
Save zaverden/1a98d8d273accf1ba02ee3138cf91c67 to your computer and use it in GitHub Desktop.
CERTS_PATH="/path/to/certs"
HOST="my.example.com"
EMAIL="email@example.com"
DOCKER_SOCK="/var/run/docker.sock"
docker run \
--name nginx-proxy \
--detach=true \
--publish 80:80 \
--publish 443:443 \
--volume $CERTS_PATH:/etc/nginx/certs:ro \
--volume /etc/nginx/vhost.d \
--volume /usr/share/nginx/html \
--volume $DOCKER_SOCK:/tmp/docker.sock:ro \
--label com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy \
jwilder/nginx-proxy
docker run \
--name nginx-proxy-letsencrypt \
--detach=true \
--volume $CERTS_PATH:/etc/nginx/certs:rw \
--volume $DOCKER_SOCK:$DOCKER_SOCK:ro \
--volumes-from nginx-proxy \
jrcs/letsencrypt-nginx-proxy-companion
docker run \
--detach=true \
--expose 3000 \
--publish 3000:3000 \
--env VIRTUAL_HOST=$HOST \
--env LETSENCRYPT_HOST=$HOST \
--env LETSENCRYPT_EMAIL=$EMAIL \
node:8-alpine node -e "require('http').createServer((req, res)=>res.write('Hello World',()=>res.end())).listen(3000);"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment