-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
83 lines (63 loc) · 2.27 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
version: "3.7"
#################### THIS SECTIONS CONTAINS SOME EXPLANATIONS AND TIPS ON HOW TO WORK WITH DOCKER-COMPOSE ##############
# The password required to access our services are specified inside a .env file in the repository root directory. The env structure is documented in the .env.template file.
# The "ports" mapping exposes the given ports to the HOST. The "expose" mapping only exposes given the ports to other services, which is what we want because only the server talks to the external world
# We use named volumes short syntax: [SOURCE:]TARGET[:MODE].
# SOURCE is the named volume, TARGET is the folder inside the container MODE is ro (read-only),
# We can use this command to dump the currently running mysql instance to a file:
# docker exec rdb bash -c 'exec mysqldump --all-databases -u"root" -p"$MYSQL_ROOT_PASSWORD"' > ./db/relational/dump/all-databases.sql
# To get an interactive shell inside a RUNNING container, use:
# 'docker-compose exec <service-mapping-key> <shell-command>'
########################################################################################################################
services:
# TODO add server container configuration
# server:
# build: ...
# depends_on:
# - rdb
# - tsdb
rdb:
build:
context: ./db/relational
# target: name-of-stage
restart: always
environment:
# The username is root (default)
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:?err}
expose:
- "3306"
healthcheck:
test:
- "CMD"
- "mysql"
- "-u"
- "root"
- "--password=$MYSQL_ROOT_PASSWORD"
- "-e"
- "SELECT table_name FROM information_schema.tables WHERE table_schema = 'stalker-rdb'"
- "stalker-rdb"
interval: 1m
timeout: 30s
retries: 3
start_period: 3m
volumes:
- type: volume
source: rdb-data
target: /var/lib/mysql
tsdb:
build:
context: ./db/time-series
# target: name-of-stage
restart: always
environment:
INFLUXDB_ADMIN_USER: root
INFLUXDB_ADMIN_PASSWORD: ${INFLUXDB_ADMIN_PASSWORD:?err}
expose:
- "8086"
volumes:
- type: volume
source: tsdb-data
target: /var/lib/influxdb
volumes:
rdb-data:
tsdb-data: