-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
102 lines (77 loc) · 2.05 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
version: "3.2"
services:
shiny:
# get image from dockerhub
image: bunop/shiny-server_shiny:latest
volumes:
- type: bind
source: ./shiny-apps
target: /srv/shiny-server/
- type: volume
source: shiny-logs
target: /var/log/shiny-server/
- type: bind
source: ./shiny/shiny-server.conf
target: /etc/shiny-server/shiny-server.conf
# expose the shiny server ports
expose:
- "3838"
# auto restart container
restart: always
db:
# get the latest mysql server
image: mariadb:10.5
# Set db environment
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
SHINY_DATABASE: ${SHINY_DATABASE}
SHINY_USER: ${SHINY_USER}
SHINY_PASSWORD: ${SHINY_PASSWORD}
# to export volume, as recommeded in https://registry.hub.docker.com/u/library/mysql/
volumes:
- type: bind
source: ./mysql-data/
target: /var/lib/mysql
- type: bind
source: ./docker-entrypoint-initdb.d/
target: /docker-entrypoint-initdb.d
uwsgi:
# get image from dockerhub
image: bunop/shiny-server_uwsgi:latest
# You can pass multiple environment variables from an external file through
# to a service’s containers with the ‘env_file’ option
env_file:
- .env
# exec a different command from image
command: uwsgi --ini /var/uwsgi/shiny_uwsgi.ini --memory-report
# set working dir for uwsgi
working_dir: /var/uwsgi/shiny/
# define volumes
volumes:
- type: bind
source: ./django-data/
target: /var/uwsgi/
# Expose the default port
# link container to database
links:
- db
nginx:
image: "nginx:1.17"
ports:
- "22080:80"
links:
- shiny
- uwsgi
volumes:
- type: bind
source: ./nginx-conf.d/
target: /etc/nginx/conf.d/
- type: bind
source: ./django-data/
target: /var/uwsgi/
# auto restart container
restart: always
networks:
default:
volumes:
shiny-logs: