-
Notifications
You must be signed in to change notification settings - Fork 239
/
docker-compose.yml
172 lines (168 loc) · 5.39 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
version: '2.1'
x-querybook-image: &querybook-image querybook-dev:latest
x-querybook-depends-on: &querybook-depends-on
mysql:
condition: service_healthy
redis:
condition: service_healthy
elasticsearch:
condition: service_healthy
x-querybook-volumes: &querybook-volumes
# This is to sync in live code change
- $PWD:/opt/querybook
- $PWD/docs_website/static/changelog:/opt/querybook/querybook/static/changelog
# 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/
services:
web:
container_name: querybook_web
image: *querybook-image
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: *querybook-volumes
depends_on: *querybook-depends-on
worker:
container_name: querybook_worker
image: *querybook-image
tty: true
stdin_open: true
command: './querybook/scripts/runservice worker -c 5'
volumes: *querybook-volumes
depends_on: *querybook-depends-on
scheduler:
container_name: querybook_scheduler
image: *querybook-image
tty: true
stdin_open: true
command: './querybook/scripts/runservice scheduler --pidfile="/opt/celerybeat.pid"'
volumes: *querybook-volumes
depends_on: *querybook-depends-on
redis:
container_name: querybook_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:
container_name: querybook_mysql
image: mysql:8.0
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
command: ['--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
elasticsearch:
container_name: querybook_elasticsearch
image: opensearchproject/opensearch:2.9.0
environment:
cluster.name: docker-cluster
bootstrap.memory_lock: 'true'
discovery.type: single-node
plugins.security.disabled: 'true'
OPENSEARCH_JAVA_OPTS: -Xms750m -Xmx750m
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- osdata1:/usr/share/opensearch/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:
osdata1:
driver: local
# file:
# driver: local
# driver_opts:
# type: 'none'
# o: 'bind'
# device: '/mnt/querybook-store/'