-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
compose_databases.yaml
87 lines (83 loc) · 2.59 KB
/
compose_databases.yaml
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
services:
mysql-server:
image: "${MYSQL_IMAGE}:${MYSQL_IMAGE_TAG}"
command:
- mysqld
- --skip-mysqlx
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_bin
# Only during upgrade from versions prior 6.4 and new installations (schema deployment)
- --log_bin_trust_function_creators=1
# Use TLS encryption for connections to database
# - --require-secure-transport
# - --ssl-ca=/run/secrets/root-ca.pem
# - --ssl-cert=/run/secrets/server-cert.pem
# - --ssl-key=/run/secrets/server-key.pem
restart: "${RESTART_POLICY}"
attach: false
volumes:
- ${DATA_DIRECTORY}/var/lib/mysql:/var/lib/mysql:rw
- ${ENV_VARS_DIRECTORY}/mysql_init/init_proxy_db.sql:/docker-entrypoint-initdb.d/mysql_init_proxy.sql:ro
# - dbsocket:/var/run/mysqld/
env_file:
- ${ENV_VARS_DIRECTORY}/.env_db_mysql
- path: ${ENV_VARS_DIRECTORY}/.env_db_mysql_override
required: false
environment:
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/MYSQL_ROOT_PASSWORD
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
# - server-key.pem
# - server-cert.pem
# - root-ca.pem
stop_grace_period: 1m
networks:
database:
aliases:
- mysql-server
postgres-server:
image: "${POSTGRESQL_IMAGE}:${POSTGRESQL_IMAGE_TAG}"
# command: -c ssl=on -c ssl_cert_file=/run/secrets/server-cert.pem -c ssl_key_file=/run/secrets/server-key.pem -c ssl_ca_file=/run/secrets/root-ca.pem
restart: "${RESTART_POLICY}"
attach: false
volumes:
- ${DATA_DIRECTORY}/var/lib/postgresql/data:/var/lib/postgresql/data:rw
- ${ENV_VARS_DIRECTORY}/.ZBX_DB_CA_FILE:/run/secrets/root-ca.pem:ro
- ${ENV_VARS_DIRECTORY}/.ZBX_DB_CERT_FILE:/run/secrets/server-cert.pem:ro
- ${ENV_VARS_DIRECTORY}/.ZBX_DB_KEY_FILE:/run/secrets/server-key.pem:ro
env_file:
- ${ENV_VARS_DIRECTORY}/.env_db_pgsql
- path: ${ENV_VARS_DIRECTORY}/.env_db_pgsql_override
required: false
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
stop_grace_period: 1m
networks:
database:
aliases:
- postgres-server
db-data-mysql:
image: "${BUSYBOX_IMAGE}:${BUSYBOX_IMAGE_TAG}"
volumes:
- ${DATA_DIRECTORY}/var/lib/mysql:/var/lib/mysql:rw
db-data-pgsql:
image: "${BUSYBOX_IMAGE}:${BUSYBOX_IMAGE_TAG}"
attach: false
volumes:
- ${DATA_DIRECTORY}/var/lib/postgresql/data:/var/lib/postgresql/data:rw
elasticsearch:
image: "${ELASTICSEARCH_IMAGE}:${ELASTICSEARCH_IMAGE_TAG}"
restart: "${RESTART_POLICY}"
attach: false
profiles:
- elasticsearch
environment:
- transport.host=0.0.0.0
- discovery.zen.minimum_master_nodes=1
networks:
database:
aliases:
- elasticsearch