version: '2' services: mariadb: image: mariadb:latest dns: # Using Cloudflare DNS - 1.1.1.1 - 1.0.0.1 - 2606:4700:4700::1111 - 2606:4700:4700::1001 environment: MYSQL_DATABASE: ${DB} MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASS} MYSQL_USER: ${DB_USER} MYSQL_PASSWORD: ${DB_USER_PASS} labels: io.rancher.container.pull_image: always {{- if .Values.HOST_LABEL}} io.rancher.scheduler.affinity:host_label: ${HOST_LABEL} {{- end}} ### Begin Traefik Configuration traefik.enable: true # Routers traefik.tcp.routers.{{.Stack.Name}}-router-mariadb.entrypoints: mysql #traefik.tcp.routers.{{.Stack.Name}}-router-mariadb.rule: HostSNI(`${TRAEFIK_HOST}`) traefik.tcp.routers.{{.Stack.Name}}-router-mariadb.rule: HostSNI(`*`) #traefik.tcp.routers.{{.Stack.Name}}-router-mariadb.tls: true #traefik.tcp.routers.{{.Stack.Name}}-router-mariadb.tls.certresolver: letsencrypt traefik.tcp.routers.{{.Stack.Name}}-router-mariadb.service: {{.Stack.Name}}-service-mariadb # Services traefik.tcp.services.{{.Stack.Name}}-service-mariadb.loadbalancer.server.port: "3306" ### End Traefik Configuration restart: on-failure volumes: - /etc/localtime:/etc/localtime:ro # Syncronize time of container with the host system - /etc/timezone:/etc/timezone:ro # Syncronize timezone of container with the host system - /Persistent/${DATA_DIR}/Database:/var/lib/mysql