-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdocker-compose.yml
212 lines (198 loc) · 6.66 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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
version: '3.8'
volumes:
pg-data-prp: {}
services:
proxy:
networks:
- etools-network
image: traefik:v2.4
command:
- --api.insecure=true
- --providers.docker
- '--providers.docker.exposedbydefault=false'
- '--entryPoints.web.address=:80'
- '--providers.docker.constraints=Label(`project.label`,`prp`)'
ports:
- '8081:80'
- '8097:8080'
container_name: prp_proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
prp_backend:
image: unicef/etools-prp:local
env_file:
- .env
build:
context: ./django_api
dockerfile: ./Dockerfile
args:
ENV: dev
volumes:
- './django_api:/code/'
- './data/etools_prp_logs:/data/etools_prp/logs'
- './data/etools_prp_uploads_unicef_progress_reports:/data/etools_prp/uploads/unicef/progress_reports'
command: bash -c "python /code/manage.py runserver 0.0.0.0:8080"
depends_on:
- db
labels:
- traefik.http.routers.prp_backend.rule=PathPrefix(`/`) && Host(`prp.localhost`)
- traefik.http.routers.prp_backend.service=prp_backend
- traefik.http.services.prp_backend.loadBalancer.server.port=8080
- traefik.enable=true
- project.label=prp
networks:
- etools-network
###### BUILT VERSION
# prp_backend:
# image: unicef/etools-prp:develop
# env_file:
# - .env
# command: bash -c "python /code/manage.py runserver 0.0.0.0:8080"
# depends_on:
# - db
# labels:
# - traefik.http.routers.prp_backend.rule=PathPrefix(`/`) && Host(`prp.localhost`)
# - traefik.http.routers.prp_backend.service=prp_backend
# - traefik.http.services.prp_backend.loadBalancer.server.port=8080
# - traefik.enable=true
# - project.label=prp
# beater-prp:
# command: bash -c "celery -A etools_prp beat -l ${CELERY_LOG_LEVEL:-info} --scheduler django_celery_beat.schedulers:DatabaseScheduler"
# image: unicef/etools-prp:develop
# env_file:
# - .env
# depends_on:
# - prp_backend
# - prp_redis
#
worker-prp:
image: unicef/etools-prp:local
env_file:
- .env
build:
context: ./django_api
dockerfile: ./Dockerfile
args:
ENV: dev
volumes:
- './django_api:/code/'
- './data/etools_prp_logs:/data/etools_prp/logs'
- './data/etools_prp_uploads_unicef_progress_reports:/data/etools_prp/uploads/unicef/progress_reports'
depends_on:
- db
command: bash -c "celery -A etools_prp worker -l ${CELERY_LOG_LEVEL:-info}"
networks:
- etools-network
db:
image: unicef/etools-prp-db
env_file:
- .env
build:
context: ./db
dockerfile: ./Dockerfile
volumes:
- pg-data-prp:/var/lib/postgresql/data/
- ./db/db_dump.bz2:/tmp/psql_data/db_dump.bz2
environment:
POSTGRES_HOST_AUTH_METHOD: trust
networks:
- etools-network
# Make sure the django .env file has the correct path for redis url set to:
prp_redis:
image: redis:6.2-alpine
container_name: prp_redis
ports:
- "6379:6379"
networks:
- etools-network
# id-management:
# image: unicef/etools-prp-id-management-frontend:1307dc7
# container_name: prp_id
# labels:
# - traefik.http.routers.prp_id.rule=PathPrefix(`/id-management/`) && Host(`prp.localhost`)
# - traefik.http.services.prp_id.loadBalancer.server.port=3000
# - traefik.http.routers.prp_id.service=prp_id
# - traefik.enable=true
# - project.label=prp
# command: bash -c 'npm run build && bash resolve_build_bundle.sh && node express.js'
# id-management:
# build:
# context: ./react/id_management_frontend
# dockerfile: ./Dockerfile
# image: unicef/etools-prp-id-management-frontend
# container_name: prp_id_local
# labels:
# - traefik.http.routers.prp_id.rule=PathPrefix(`/id-management/`) && Host(`prp.localhost`)
# - traefik.http.routers.prp_id.middlewares=prp_id-stripprefix
# - traefik.http.middlewares.prp_id-stripprefix.stripprefix.prefixes=/id-management/
# - traefik.http.services.prp_id.loadBalancer.server.port=3000
# - traefik.http.routers.prp_id.service=prp_id
# - traefik.enable=true
# - project.label=prp
# volumes:
# - ./react/id_management_frontend/:/code
# command: bash -c "npm run start"
# cluster:
# image: unicef/etools-prp-cluster-fe:develop
# container_name: prp_cl
# labels:
# - traefik.http.routers.prp_cl.rule=PathPrefix(`/cluster/`) && Host(`prp.localhost`)
# - traefik.http.services.prp_cl.loadBalancer.server.port=8082
# - traefik.http.routers.prp_cl.service=prp_cl
# - traefik.enable=true
# - project.label=prp
# command: node express.js
#
# cluster:
# build:
# context: ./frontend_cluster
# dockerfile: ./Dockerfile-dev
# image: prpdev/etools-fe-cluster:dev
# container_name: prp_cl_local
# labels:
# - traefik.http.routers.prp_cl.rule=PathPrefix(`/cluster/`) && Host(`prp.localhost`)
# - traefik.http.routers.prp_cl.middlewares=prp_cl-stripprefix
# - traefik.http.middlewares.prp_cl-stripprefix.stripprefix.prefixes=/cluster/
# - traefik.http.services.prp_cl.loadBalancer.server.port=8082
# - traefik.http.routers.prp_cl.service=prp_cl
# - traefik.enable=true
# - project.label=prp
# volumes:
# - "./frontend_cluster:/code"
# command: ${FE_COMMAND:-sh -c "npm run devPoly3"}
#
# ip:
# image: unicef/etools-prp-polymer:develop
# container_name: prp_ip
# labels:
# - traefik.http.routers.prp_ip.rule=PathPrefix(`/ip/`) && Host(`prp.localhost`)
# - traefik.http.services.prp_ip.loadBalancer.server.port=8082
# - traefik.http.routers.prp_ip.service=prp_ip
# - traefik.enable=true
# - project.label=prp
# command: node express.js
ip:
build:
context: ./frontend_ip
dockerfile: ./Dockerfile-dev
image: etoolsdev/etools-ip:rollup
container_name: prp_ip_local
labels:
- traefik.http.routers.prp_ip.rule=PathPrefix(`/ip/`) && Host(`prp.localhost`)
- traefik.http.routers.prp_ip.middlewares=prp_ip-stripprefix
- traefik.http.middlewares.prp_ip-stripprefix.stripprefix.prefixes=/ip/
- traefik.http.services.prp_ip.loadBalancer.server.port=8082
- traefik.http.routers.prp_ip.service=prp_ip
- traefik.enable=true
- project.label=prp
ports:
- "4001:4001"
volumes:
- './frontend_ip:/code'
command: ${FE_COMMAND:-sh -c "npm start"}
networks:
- etools-network
networks:
etools-network:
external:
name: etools_network