-
Notifications
You must be signed in to change notification settings - Fork 60
Docker Compose Example
Jake Tamé edited this page Oct 30, 2017
·
8 revisions
This is a simple docker compose example without any reverse proxy
version: '3'
services:
watcher:
container_name: watcher
image: linuxserver/watcher
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- /app/watcher/config:/config
- /app/watcher/userdata:/app/watcher/userdata
- /data/downloads:/data/downloads
- /data/media/movies:/data/media/movies
environment:
- PGID=1002
- PUID=1001
- TZ=Europe/London
- You will need to create a docker bridge network called proxy-tier.
- You will need to adjust the volumes paths to point to your local paths instead of the examples
- Download the nginx.tmpl for use by docker-gen curl -o nginx.tmpl https://raw.githubusercontent.com/jwilder/docker-gen/master/templates/nginx.tmpl
version: '3'
services:
nginx:
image: nginx
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
container_name: nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
depends_on:
- "watcher"
volumes:
- /app/nginx/data/conf.d:/etc/nginx/conf.d
- /app/nginx/data/vhost.d:/etc/nginx/vhost.d
- /app/nginx/data/html:/usr/share/nginx/html
- /app/nginx/data/certs:/etc/nginx/certs:ro
nginx-gen:
image: jwilder/docker-gen
command: -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
container_name: nginx-gen
restart: unless-stopped
volumes:
- /app/nginx/data/conf.d:/etc/nginx/conf.d
- /app/nginx/data/vhost.d:/etc/nginx/vhost.d
- /app/nginx/data/html:/usr/share/nginx/html
- /app/nginx/data/certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
nginx-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: nginx-letsencrypt
restart: unless-stopped
volumes:
- /app/nginx/data/conf.d:/etc/nginx/conf.d
- /app/nginx/data/vhost.d:/etc/nginx/vhost.d
- /app/nginx/data/html:/usr/share/nginx/html
- /app/nginx/data/certs:/etc/nginx/certs:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
NGINX_DOCKER_GEN_CONTAINER: "nginx-gen"
NGINX_PROXY_CONTAINER: "nginx"
watcher:
container_name: watcher
image: linuxserver/watcher
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- /app/watcher/config:/config
- /app/watcher/userdata:/app/watcher/userdata
- /data/downloads:/data/downloads
- /data/media/movies:/data/media/movies
environment:
PGID=1002
PUID=1001
TZ=Europe/London
VIRTUAL_HOST: *subdomain*.*hostname*
LETSENCRYPT_HOST: *subdomain*.*hostname*
LETSENCRYPT_EMAIL: *email here*
networks:
default:
external:
name: proxy-tier