-
Notifications
You must be signed in to change notification settings - Fork 1
/
stack.yml
119 lines (108 loc) · 2.35 KB
/
stack.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
version: "3.9"
services:
web:
image: ${ACCOUNT_FRONTEND_IMAGE}
depends_on:
- api
ports:
- "8088:80"
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: accounts.web
api:
depends_on:
- mysql
image: ${ACCOUNT_IMAGE}
ports:
- "8081:80"
configs:
- source: plain_config
target: /config/plain.yaml
mode: 0440
secrets:
- source: secret_config
target: /config/secret.yaml
mode: 0440
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: api.{{.Name}}
mysql:
image: mysql:5.7
deploy:
placement:
constraints:
- "node.labels.role==db"
volumes:
- mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DB}
command: --character-set-server=utf8mb4 --default-time-zone=+08:00
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: mysql.{{.Name}}
db-migration:
image: goose
depends_on:
- mysql
working_dir: /migrations
volumes:
- ./src/database/migrations:/migrations
command: goose up
environment:
GOOSE_DRIVER: mysql
GOOSE_DBSTRING: root:${MYSQL_PASSWORD}@tcp(mysql)/${MYSQL_DB}
deploy:
restart_policy:
condition: none
placement:
constraints:
- "node.labels.role==db"
fluentd:
image: bitmyth/fluentd-es:v1.0.0
environment:
FLUENTD_CONF: 'fluent.conf'
configs:
- source: fluentd_config
target: /fluentd/etc/fluent.conf
ports:
- "24224:24224"
- "24224:24224/udp"
deploy:
mode: global
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2
environment:
- "discovery.type=single-node"
ports:
- "9200:9200"
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '1'
memory: 1.5G
kibana:
image: kibana:7.10.1
depends_on:
- "elasticsearch"
ports:
- "5601:5601"
volumes:
mysql:
configs:
plain_config:
file: ./config/plain.yaml
fluentd_config:
file: ./config/fluentd/fluent.conf
secrets:
secret_config:
file: ./config/secret.yaml