-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.prod.yaml.template
142 lines (116 loc) · 3.27 KB
/
compose.prod.yaml.template
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# NOTE: Set the values on the production site; including
# 'user' (except for the simulator) and some env vars.
services:
web:
extends:
file: compose.base.yaml
service: web
build:
args:
PRODUCTION_UID: ${PRODUCTION_UID}
PRODUCTION_GID: ${PRODUCTION_GID}
volumes:
# The global config
- ./config_prod.py:/main/config.py
# The redis unix socket directory
- redis_sock_dir:/var/run/redis/
# The logs directory
- /var/log/codefights/:/var/log/codefights/
# The media root
- uploaded_files:/srv/codefights/
user: app
nginx:
extends:
file: compose.base.yaml
service: nginx
build:
args:
PRODUCTION_UID: ${PRODUCTION_UID}
PRODUCTION_GID: ${PRODUCTION_GID}
volumes:
- uploaded_files:/srv/codefights/
- /var/log/codefights/nginx/:/var/log/nginx/
# Replace with the directory holding the certificates.
- ...:/etc/certs/
# Replace with the acme challenge directory.
- ...:/etc/acme/
environment:
# To be populated...
SERVER_MAIN_DOMAIN:
SERVER_FILES_DOMAIN:
MEDIA_ROOT:
STATIC_ROOT:
MEDIA_URL:
STATIC_URL:
SSL_CERT_PATH:
SSL_KEY_PATH:
ACME_CHALLENGE_ROOT:
user: app
# For WebSockets. Later ...
# async_web:
# ...
redis:
extends:
file: compose.base.yaml
service: redis
build:
args:
PRODUCTION_UID: ${PRODUCTION_UID}
PRODUCTION_GID: ${PRODUCTION_GID}
volumes:
# We mount the directory rather than the socket file itself, as redis
# will complain if the file is already created.
- redis_sock_dir:/var/run/redis/
# The logs directory
- /var/log/codefights/redis/:/var/log/redis/
user: app
db:
extends:
file: compose.base.yaml
service: db
volumes:
- postgres_data:/var/lib/postgresql/data
simulator:
extends:
file: compose.base.yaml
service: simulator
volumes:
# The global config
- ./config_prod.py:/main/config.py
# The redis unix socket directory
- redis_sock_dir:/var/run/redis/
# The logs directory
- /var/log/codefights:/var/log/codefights/
# The media root
- uploaded_files:/srv/codefights/
result_processor:
extends:
file: compose.base.yaml
service: result_processor
build:
args:
PRODUCTION_UID: ${PRODUCTION_UID}
PRODUCTION_GID: ${PRODUCTION_GID}
volumes:
# The global config
- ./config_prod.py:/main/config.py
# The redis unix socket directory
- redis_sock_dir:/var/run/redis/
# The logs directory
- /var/log/codefights/:/var/log/codefights/
# The media root
- uploaded_files:/srv/codefights/
user: app
volumes:
# tmpfs volumes cannot be shared between containers,
# so we use a normal docker volume. Apparently, it
# must be external; otherwise it will mount as root
# instead of copying what's in the service 'redis',
# which is set to have the correct owner (user 'app').
# I'm not sure why this happens ... search later.
redis_sock_dir:
external: true
postgres_data:
external: true
uploaded_files:
external: true