Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
sudo docker pull nginx:alpine
sudo docker pull jwilder/docker-gen
sudo docker pull jrcs/letsencrypt-nginx-proxy-companion
sudo docker pull zzrot/alpine-ghost
wget https://raw.githubusercontent.com/jwilder/nginx-proxy/master/nginx.tmpl
sudo cp nginx.tmpl /volumes/proxy/templates/
sudo docker run -d -p 80:80 -p 443:443 \
--name nginx \
--restart=unless-stopped \
-v /etc/nginx/conf.d \
-v /etc/nginx/vhost.d \
-v /usr/share/nginx/html \
-v $(pwd)/../../volumes/proxy/cache:/tmp/nginx:rw \
-v $(pwd)/../../volumes/proxy/certs:/etc/nginx/certs:ro \
-t nginx:alpine
sudo docker run -d \
--name nginx-gen \
--restart=unless-stopped \
--volumes-from nginx \
-v $(pwd)/../../volumes/proxy/templates/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
-t jwilder/docker-gen \
-notify-sighup nginx \
-watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
sudo docker run -d \
-e "NGINX_DOCKER_GEN_CONTAINER=nginx-gen" \
--name letsencrypt \
--restart=unless-stopped \
-v $(pwd)/../../volumes/proxy/certs:/etc/nginx/certs:rw \
--volumes-from nginx \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
jrcs/letsencrypt-nginx-proxy-companion
sudo docker run -d -p 5000:2368 \
-v /volumes/ghost:/var/lib/ghost/ \
--name ghost \
--restart=unless-stopped \
-e "VIRTUAL_HOST=www.kli.dk" \
-e "LETSENCRYPT_HOST=www.kli.dk" \
-e "LETSENCRYPT_EMAIL=m@kli.dk" \
-e "NODE_ENV=production" \
-e "PROD_DOMAIN=https://www.kli.dk" \
zzrot/alpine-ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment