forked from pinterest/querybook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
181 lines (178 loc) · 5.8 KB
/
docker-compose.yml
File metadata and controls
181 lines (178 loc) · 5.8 KB
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
version: '2.1'
services:
web:
image: querybook-dev:latest
tty: true
stdin_open: true
# network_mode: 'host'
command: './querybook/scripts/bundled_docker_run_web --initdb --initweb'
ports:
- '${PORT:-10001}:${PORT:-10001}'
expose:
- '${PORT:-10001}'
environment:
PORT: '${PORT:-10001}'
APIPORT: '${APIPORT:-3000}'
HOT_RELOAD: '${HOT_RELOAD:-true}'
restart: 'always'
volumes:
# This is for code change via watcher
- $PWD:/opt/querybook
# See https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /opt/querybook/node_modules/
# Make sure the build files don't leak back
- /opt/querybook/dist/
- $PWD/containers/bundled_querybook_config.yaml:/opt/querybook/querybook/config/querybook_config.yaml
# - file:/opt/store/
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
elasticsearch:
condition: service_healthy
worker:
image: querybook-dev:latest
tty: true
stdin_open: true
command: './querybook/scripts/runservice worker -c 5'
# restart: "always"
volumes:
# This is for code change via watcher
- $PWD:/opt/querybook
- $PWD/containers/bundled_querybook_config.yaml:/opt/querybook/querybook/config/querybook_config.yaml
# - file:/opt/store/
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
elasticsearch:
condition: service_healthy
scheduler:
image: querybook-dev:latest
tty: true
stdin_open: true
command: './querybook/scripts/runservice scheduler --pidfile="/opt/celerybeat.pid"'
volumes:
# This is for code change via watcher
- $PWD:/opt/querybook
# See https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /opt/querybook/node_modules/
# Make sure the build files don't leak back
- /opt/querybook/dist/
- $PWD/containers/bundled_querybook_config.yaml:/opt/querybook/querybook/config/querybook_config.yaml
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
redis:
image: redis:5.0.9
restart: always
command: ['redis-server', '--appendonly', 'yes']
hostname: redis
ports:
- '6379:6379'
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 30s
timeout: 10s
retries: 3
mysql:
image: mysql:5.7
restart: always
ports:
# <Port exposed> : < MySQL Port running inside container>
- '3306:3306'
expose:
# Opens port 3306 on the container
- '3306'
# Where our data will be persisted
volumes:
- my-db:/var/lib/mysql
environment:
MYSQL_HOST: mysql:3306
MYSQL_DATABASE: querybook2
MYSQL_USER: test
MYSQL_PASSWORD: passw0rd
# Password for root access
MYSQL_ROOT_PASSWORD: hunter2
healthcheck:
test:
[
'CMD-SHELL',
"mysqladmin -h 'localhost' -u test -ppassw0rd ping --silent",
]
interval: 30s
timeout: 30s
retries: 3
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.16.2
environment:
cluster.name: docker-cluster
bootstrap.memory_lock: 'true'
discovery.type: single-node
ES_JAVA_OPTS: -Xms750m -Xmx750m
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- esdata1:/usr/share/elasticsearch/data
ports:
- 9200:9200
healthcheck:
test:
[
'CMD-SHELL',
'curl --silent --fail localhost:9200/_cluster/health || exit 1',
]
interval: 30s
timeout: 30s
retries: 3
# EMAIL SERVER EXAMPLE
# If you need email to work use this
# dockerhostforward:
# expose:
# - '25'
# image: qoomon/docker-host
# cap_add: ['NET_ADMIN', 'NET_RAW']
# mem_limit: 8M
# restart: on-failure
# CELERY FLOWER EXAMPLE
# If you want flower monitoring, use this
# Remember to put flower as part of local.txt
# flower:
# image: querybook-dev:latest
# tty: true
# stdin_open: true
# # network_mode: "host"
# command: './querybook/scripts/runservice flower --port=5566'
# ports:
# - '5566:5566'
# expose:
# - '5566'
# restart: 'always'
# volumes:
# # This is for code change via watcher
# - $PWD:/opt/querybook
# - $PWD/containers/bundled_querybook_config.yaml:/opt/querybook/querybook/config/querybook_config.yaml
# depends_on:
# mysql:
# condition: service_healthy
# redis:
# condition: service_healthy
volumes:
my-db:
esdata1:
driver: local
# file:
# driver: local
# driver_opts:
# type: 'none'
# o: 'bind'
# device: '/mnt/querybook-store/'