Skip to content

Instantly share code, notes, and snippets.

@snorremd
Created September 12, 2015 13:01
Show Gist options
  • Save snorremd/019ba2b074030215c55d to your computer and use it in GitHub Desktop.
Save snorremd/019ba2b074030215c55d to your computer and use it in GitHub Desktop.
nginx and dockergen containers for automatic proxying
nginx:
image: nginx:latest
volumes:
- /tmp/nginx:/etc/nginx/conf.d
- /srv/nginx/certs:/etc/nginx/certs
ports:
- "80:80"
#- "443:443" Only add if you want ssl
dockergen:
image: jwilder/docker-gen
environment:
- DEFAULT_HOST=yourhost.example
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- /srv/nginx-proxy:/etc/docker-gen/templates
volumes_from:
- nginx
command: -notify-sighup nginx -watch -only-exposed /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment