forked from comses/comses.net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdc-prod.yml
162 lines (161 loc) · 4.3 KB
/
dc-prod.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
version: '3'
services:
redis:
image: redis:6-alpine
restart: always
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
networks:
- cms
volumes:
- ./deploy/conf/redis.conf:/usr/local/etc/redis/redis.conf
- ./docker/shared/redis:/data
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION}
restart: always
ports:
- "127.0.0.1:9200:9200"
environment:
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
deploy:
resources:
limits:
memory: 1g
networks:
- esnet
cap_add:
- IPC_LOCK
volumes:
- ./deploy/elasticsearch.conf.d/log4j2.properties:/usr/share/elasticsearch/config/log4j2.properties
- ./deploy/elasticsearch.conf.d/elasticsearch-primary.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- esdata1:/usr/share/elasticsearch/data
# FIXME: duplication bad
elasticsearch2:
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION}
restart: always
environment:
- bootstrap.memory_lock=true
- node.name=esnode2
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.seed_hosts=elasticsearch"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
deploy:
resources:
limits:
memory: 1g
cap_add:
- IPC_LOCK
networks:
- esnet
volumes:
- ./deploy/elasticsearch.conf.d/elasticsearch-node.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- ./deploy/elasticsearch.conf.d/log4j2.properties:/usr/share/elasticsearch/config/log4j2.properties
- esdata2:/usr/share/elasticsearch/data
${DB_HOST}:
image: postgis/postgis:10-3.1
restart: always
volumes:
- ./docker/shared/pgdata:/var/lib/postgresql/data
networks:
- db
environment:
# autofilled by ./build.sh envsubst
# FIXME: replace with init sql script, see https://github.com/docker/docker/issues/13490
POSTGRES_USER: "${DB_USER}"
POSTGRES_PASSWORD: "${DB_PASSWORD}"
POSTGRES_DB: "${DB_NAME}"
js:
build: frontend
image: comses/cmsjs:${RELEASE_VERSION}
command: ['yarn', 'build']
environment:
NODE_ENV: "production"
volumes:
- ./frontend/yarn.lock:/code/yarn.lock
- ./frontend/src:/code/src
- ./docker/shared/webpack:/shared/webpack
- ./deploy/conf/config.ini:/secrets/config.ini
maintenance:
image: nginx:stable
ports:
- "127.0.0.1:8889:80"
volumes:
- ./deploy/nginx/nginx-maintenance.conf:/etc/nginx/nginx.conf
- ./deploy/nginx/maintenance:/srv
nginx:
image: nginx:stable
restart: always
volumes:
- ./deploy/nginx/nginx-haproxy.conf:/etc/nginx/nginx.conf
- ./deploy/nginx/uwsgi_params:/etc/nginx/uwsgi_params
- ./docker/shared/logs/nginx:/var/log/nginx
- ./deploy/nginx/well-known:/srv/.well-known
- ./docker/shared/static:/srv/static
- ./docker/shared/media:/srv/media
- ./docker/shared/library:/library
- sockets:/shared/sockets
depends_on:
- cms
networks:
- cms
command: ["nginx", "-g", "daemon off;"]
ports:
- "80:80"
cms:
build:
context: ./django
args:
REQUIREMENTS_FILE: requirements.txt
UBUNTU_MIRROR: "Compute.clouds.archive.ubuntu.com"
RUN_SCRIPT: "./deploy/prod.sh"
image: comses/cms:${RELEASE_VERSION}
restart: always
volumes:
- ./deploy/conf/config.ini:/secrets/config.ini
- ./deploy/elasticsearch.conf.d:/etc/elasticsearch
- ./docker/shared:/shared
- sockets:/shared/sockets
depends_on:
- ${DB_HOST}
- elasticsearch
- elasticsearch2
- redis
networks:
- esnet
- cms
- db
environment:
DJANGO_SETTINGS_MODULE: "core.settings.production"
DB_USER: ${DB_USER}
DB_HOST: ${DB_HOST}
DB_NAME: ${DB_NAME}
DB_PORT: ${DB_PORT}
ports:
- "127.0.0.1:9191:9191" # uWSGI stats server
networks:
esnet:
driver: bridge
cms:
driver: bridge
db:
driver: bridge
volumes:
sockets:
driver: local
esdata1:
driver: local
esdata2:
driver: local