forked from pinterest/querybook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
163 lines (162 loc) · 5.12 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
version: '2.1'
services:
web:
image: querybook-dev:latest
cap_add:
- SYS_PTRACE
tmpfs: /tmp:exec,mode=777
tty: true
stdin_open: true
# network_mode: "host"
command: './querybook/scripts/bundled_docker_run_web'
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
cap_add:
- SYS_PTRACE
tmpfs: /tmp:exec,mode=777
tty: true
stdin_open: true
command: './querybook/scripts/runservice worker'
# 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
cap_add:
- SYS_PTRACE
tmpfs: /tmp:exec,mode=777
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:6.6.1
environment:
cluster.name: docker-cluster
bootstrap.memory_lock: 'true'
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
# 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
volumes:
my-db:
esdata1:
driver: local
# file:
# driver: local
# driver_opts:
# type: 'none'
# o: 'bind'
# device: '/mnt/querybook-store/'