-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathdocker-compose.yml
128 lines (116 loc) · 3.69 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
version: "2"
services:
######################### SETUP OF PROXY AND SSL ###############################
# Don't edit this service
nginx:
restart: always
image: nginx
container_name: nginx
ports:
- "80:80"
- "443:443"
volumes:
- "/etc/nginx/conf.d"
- "/etc/nginx/vhost.d"
- "/usr/share/nginx/html"
- "./volumes/proxy/certs:/etc/nginx/certs:ro"
# Don't edit this service
nginx-gen:
restart: always
image: jwilder/docker-gen
container_name: nginx-gen
depends_on:
- nginx
volumes:
- "/var/run/docker.sock:/tmp/docker.sock:ro"
- "./volumes/proxy/templates/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro"
volumes_from:
- nginx
entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
# Don't edit this service
letsencrypt-nginx-proxy-companion:
restart: always
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt-nginx-proxy-companion
depends_on:
- nginx
- nginx-gen
volumes_from:
- nginx
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./volumes/proxy/certs:/etc/nginx/certs:rw"
environment:
- NGINX_DOCKER_GEN_CONTAINER=nginx-gen
####################### SETUP OF DOCKER CONTAINERS #############################
# Spin up a Shiny docker
shiny:
restart: always
image: mikkelkrogsholm/shiny
container_name: shiny
expose:
- "3838"
environment:
- VIRTUAL_HOST=shiny.mydomain.com # change line
- VIRTUAL_NETWORK=nginx-proxy # change line
- VIRTUAL_PORT=80
- LETSENCRYPT_HOST=shiny.mydomain.com # change line
- LETSENCRYPT_EMAIL=me@myemail.com # change line
volumes:
- shiny-apps:/srv/shiny-server/
- ./volumes/shiny/logs:/var/log/
- r-packages:/usr/local/lib/R/site-library
# Spin up Rstudio docker
## Use this version to add several users
# rstudio:
# restart: always
# build: ./addusers
# container_name: rstudio
# depends_on:
# - shiny
# expose:
# - "8787"
# environment:
# - VIRTUAL_HOST=rstudio.mydomain.com # change line
# - VIRTUAL_NETWORK=nginx-proxy
# - VIRTUAL_PORT=80
# - LETSENCRYPT_HOST=rstudio.mydomain.com # change line
# - LETSENCRYPT_EMAIL=me@myemail.com # change line
# volumes:
# - shiny-apps:/home/apps
# - r-packages:/usr/local/lib/R/site-library
rstudio:
restart: always
image: mikkelkrogsholm/rstudio
container_name: rstudio
depends_on:
- shiny
expose:
- "8787"
environment:
- VIRTUAL_HOST=rstudio.mydomain.com # change line
- VIRTUAL_NETWORK=nginx-proxy
- VIRTUAL_PORT=80
- LETSENCRYPT_HOST=rstudio.mydomain.com # change line
- LETSENCRYPT_EMAIL=me@myemail.com # change line
- USER=YOUR_USER # change line
- PASSWORD=YOUR_PASSWORD # change line
volumes:
- shiny-apps:/home/apps
- r-packages:/usr/local/lib/R/site-library
- backup:/home/
# Watchtower is a process for watching your Docker containers and automatically
# updating and restarting them whenever their base image is refreshed.
watchtower:
restart: always
image: v2tec/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /root/.docker/config.json:/config.json
# Look for new images every midnight and Removes old images
command: --schedule "0 0 0 *" --cleanup
# Create data docker volumes
volumes:
shiny-apps: # holds the shiny apps
r-packages: # holds new common libraries
backup: # makes backup of the /home folder in Rstudio docker.