-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdocker-compose.yml
230 lines (216 loc) · 5.41 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
networks:
core:
driver: bridge
djqs-network:
driver: bridge
djrs-network:
driver: bridge
services:
dj:
container_name: dj
stdin_open: true
tty: true
networks:
- core
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4317
- OTEL_RESOURCE_ATTRIBUTES=service.name=datajunction.server
- DOTENV_FILE=${DOTENV_FILE:-/code/.env}
- OAUTHLIB_INSECURE_TRANSPORT=1
build:
context: ./datajunction-server
args:
RELOAD: "--reload"
volumes:
- ./datajunction-server:/code
ports:
- "8000:8000"
depends_on:
- db-migration
- postgres_metadata
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health/"]
interval: 30s
retries: 3
start_period: 10s
timeout: 5s
postgres_metadata:
container_name: postgres_metadata
image: postgres:latest
networks:
- core
hostname: postgres_metadata
volumes:
- ./postgres_metadata:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=dj
- POSTGRES_USER=dj
- POSTGRES_DB=dj
- PGUSER=dj
ports:
- "5432:5432"
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
djui:
container_name: djui
image: node:19
working_dir: /usr/src/app
ports:
- "3000:3000"
stdin_open: true
volumes:
- ./datajunction-ui:/usr/src/app/
- ./datajunction-ui/node_modules:/usr/src/app/node_modules
command: sh -c "yarn && yarn webpack-build && yarn webpack-start --host 0.0.0.0 --port 3000"
djqs:
container_name: djqs
profiles: ["demo"]
stdin_open: true
tty: true
networks:
- core
- djqs-network
build:
context: ./datajunction-query
volumes:
- ./datajunction-query:/code
ports:
- "8001:8001"
depends_on:
- djqs-db-migration
- postgres_metadata
db-migration:
container_name: db-migration
networks:
- core
build:
context: ./datajunction-server
volumes:
- ./datajunction-server:/code
working_dir: /code/datajunction_server
command: /bin/bash -c "alembic -x uri="postgresql+psycopg://dj:dj@postgres_metadata:5432/dj" upgrade head"
restart: on-failure
depends_on:
postgres_metadata:
condition: service_healthy
extra_hosts:
- "host.docker.internal:host-gateway"
db-seed:
container_name: db-seed
networks:
- core
image: postgres:latest
depends_on:
db-migration:
condition: service_completed_successfully
environment:
- PGPASSWORD=dj
volumes:
- ./datajunction-server/init_data:/init_data
command: >
/bin/bash -c "
psql -h postgres_metadata -U dj -d dj -f /init_data/seed.sql
"
djqs-db-migration:
container_name: djqs-db-migration
profiles: ["demo"]
networks:
- core
- djqs-network
build:
context: ./datajunction-query
volumes:
- ./datajunction-query:/code
command: /bin/bash -c "alembic -x uri="postgresql+psycopg://dj:dj@postgres_metadata:5432/dj" upgrade head"
restart: on-failure
depends_on:
postgres_metadata:
condition: service_healthy
djrs-redis:
container_name: djrs-redis
profiles: ["demo"]
image: redis:6-alpine
ports:
- "6379:6379"
networks:
- djrs-network
djrs-worker:
container_name: djrs-worker
profiles: ["demo"]
build:
context: ./datajunction-reflection
command: ["celery", "-A", "datajunction_reflection.worker.app", "worker", "--loglevel", "INFO"]
networks:
- core
- djrs-network
volumes:
- ./datajunction-reflection:/code
depends_on:
- djrs-redis
- dj
djrs-beat:
container_name: djrs-beat
profiles: ["demo"]
build:
context: ./datajunction-reflection
command:
["celery", "--app", "datajunction_reflection.worker.app", "beat", "--loglevel", "INFO"]
networks:
- djrs-network
depends_on:
- djrs-redis
- dj
restart: "no"
volumes:
- ./datajunction-reflection:/code
jupyter-notebook:
image: jupyter/scipy-notebook
container_name: jupyter
profiles: ["demo"]
networks:
- core
ports:
- "8181:8888"
volumes:
- ./notebooks:/home/jovyan/notebooks
- ./datajunction-clients/python:/home/jovyan/notebooks/datajunction
environment:
JUPYTER_ENABLE_LAB: "yes"
depends_on:
dj:
condition: service_healthy
command: >
/bin/bash -c "
pip install -e /home/jovyan/notebooks/datajunction/ && \
if [ ! -f /home/jovyan/notebooks/.notebook_executed ]; then \
jupyter execute '/home/jovyan/notebooks/Modeling the Roads Example Database.ipynb' && \
touch /home/jovyan/notebooks/.notebook_executed; \
fi && \
start-notebook.sh --NotebookApp.token='' --NotebookApp.password=''
"
jaeger:
container_name: jaeger
profiles: ["demo"]
image: jaegertracing/all-in-one:latest
ports:
- "16686:16686"
- "14268:14268"
environment:
- COLLECTOR_OTLP_ENABLED=true
- LOG_LEVEL=debug
networks:
- core
dj-trino:
container_name: dj-trino
profiles: ["demo"]
image: 'trinodb/trino:latest'
hostname: trino-coordinator
ports:
- '8080:8080'
networks:
- djqs-network