forked from Islandora-Devops/isle-dc
-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.mariadb.yml
41 lines (41 loc) · 1.79 KB
/
docker-compose.mariadb.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
version: "3.7"
networks:
default:
internal: true
volumes:
mariadb-data:
mariadb-files:
services:
# Always included even if PostgreSQL is included as Matomo only works with MySQL.
# https://github.com/matomo-org/matomo/issues/500
mariadb:
image: ${REPOSITORY:-islandora}/mariadb:${TAG:-latest}
restart: unless-stopped
volumes:
- mariadb-data:/var/lib/mysql
- mariadb-files:/var/lib/mysql-files
# Allows for access to the database through traefik to support using Drush locally.
# This should not be used in production.
#
# Since this is not http, but tcp traffic it does does not understand the concept of a "host".
# so we must dedicate a port to it in traefik, and direct all traffic to this router: HostSNI(`*`).
labels:
- traefik.enable=true
- traefik.tcp.services.${COMPOSE_PROJECT_NAME-isle-dc}-mysql.loadbalancer.server.port=3306
- traefik.tcp.routers.${COMPOSE_PROJECT_NAME-isle-dc}-mysql_tcp.service=${COMPOSE_PROJECT_NAME-isle-dc}-mysql
- traefik.tcp.routers.${COMPOSE_PROJECT_NAME-isle-dc}-mysql_tcp.entrypoints=mysql
- traefik.tcp.routers.${COMPOSE_PROJECT_NAME-isle-dc}-mysql_tcp.rule=HostSNI(`*`)
networks:
default:
# Allow drupal to access the database with it's edge name to reference
# this service in addition to `database`. This allows us to use the edge
# name in settings.php so Drush on the host machine can be used in the
# codebase folder.
aliases:
- mariadb-${COMPOSE_PROJECT_NAME-isle-dc}.${DRUPAL_SITE_HOST-traefik.me}
- mariadb-${COMPOSE_PROJECT_NAME-isle-dc}-${DRUPAL_SITE_HOST-traefik.me}
gateway:
healthcheck:
test: "mysql mysql -N -e \"SELECT count(*) from information_schema.SCHEMATA;\""
timeout: 20s
retries: 10