A minimal MariaDB (MySQL) container for Drupal projects.
10K+

Flight Deck DB is a minimalist MySQL/mariaDB container for Drupal sites on Kubernetes and Docker. You can use it both for local development and production.
Features:
There are several tags available for this container, each with different Solr and module support:
| mariaDB version | MySQL equiv. | Tags |
|---|---|---|
| 10.3 | 5.7 | 10, 10.3, latest |
This container does not use environment variables for configuration. Instead, the flight-deck-db.yml file is used to handle all configuration.
---
mysql_root_password: "root"
mysql_key_buffer_size: "256M"
mysql_max_allowed_packet: "64M"
mysql_table_open_cache: "256"
mysql_query_cache_size: "0"
Where:
mysql_root_password_file is defined.256M64M.256.0 as the query cache can be counterproductive for Drupal sites.This container supports multiple databases by defining the mysql_databases list:
---
mysql_databases:
- name: "drupal"
state: present
encoding: "latin1"
collation: "latin1_general_ci"
Each item has the following variables:
present or absent. Specify absent to delete an existing database. Optional, defaults to present.utf8.utf8_general_ciThis container also supports multiple users by defining the mysql_users list:
---
mysql_users:
- name: "drupal"
state: present
host: "%"
password: "drupal"
priv: "drupal.*:ALL"
Each item has the following variables:
present or absent. Specify absent to delete existing users. Optional, defaults to present.passwordFile is defined.database.table:privilege. Multiple privileges can be specified with a comma (,), multiple databases are separated with a /. Optional, but highly recommended.Sometimes, you may wish to keep certain credentials in separate files from the rest of the configuration. One such case is if you want to keep flight-deck-db.yml in a Kubernetes configmap, but keep the database passwords in secrets instead.
mysql_root_password_file: /config/mysql-root-user/password.txt
mysql_users:
- name: "drupal"
state: present
host: "%"
passwordFile: "/config/mysql-drupal-user/password.txt"
priv: "drupal.*:ALL"
Where:
root account.All paths are to the file inside the container.
Use the ten7.flightdeck_cluster role on Ansible Galaxy to deploy DB as a statefulset:
flightdeck_cluster:
namespace: "database"
secrets:
- name: "flight-deck-db"
files:
- name: "flight-deck-db.yml"
content: |
mysql_root_password: "root"
mysql_databases:
- name: "drupal"
encoding: "latin1"
collation: "latin1_general_ci"
mysql_users:
- name: "drupal"
host: "%"
password: "drupal"
priv: "drupal.*:ALL"
mysql_key_buffer_size: "256M"
mysql_max_allowed_packet: "64M"
mysql_table_open_cache: "256"
mysql_query_cache_size: "0"
mysql:
size: "10Gi"
secrets:
- name: "flight-deck-db"
path: "/config/mysql"
Create the flight-deck-db.yml file relative to your docker-compose.yml. Define the db service mounting the file as a volume:
version: '3'
services:
db:
image: ten7/flight-deck-db:10
ports:
- 3306:3306
volumes:
- /var/lib/mysql
- ./db-backups:/tmp/db-backups:cached
- ./flight-deck-db.yml:/config/mysql/flight-deck-db.yml
This container is part of the Flight Deck library of containers for Drupal local development and production workloads on Docker, Swarm, and Kubernetes.
Flight Deck is used and supported by TEN7.
If you need to get verbose output from the entrypoint, set flightdeck_debug to true or yes in the config file.
---
flightdeck_debug: yes
This container uses Ansible to perform start-up tasks. To get even more verbose output from the start up scripts, set the ANSIBLE_VERBOSITY environment variable to 4.
If the container will not start due to a failure of the entrypoint, set the FLIGHTDECK_SKIP_ENTRYPOINT environment variable to true or 1, then restart the container.
If you've been locked out of the database due to a permissions problem, you can override the default database startup command to start without authentication and networking.
In Kubernetes:
Edit the database Deployment or StatefulSet to override the flight-deck-db container's default command. Optionally, add an env section to set debug flags as described above.
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
spec:
template:
spec:
containers:
- image: ten7/flight-deck-db:develop
command:
- mysqld_safe
- --skip-grant-tables
- --skip-networking
env:
- name: FLIGHTDECK_SKIP_ENTRYPOINT
value: "1"
- name: ANSIBLE_VERBOSITY
value: "4"
In Docker Compose:
Edit your docker-compose.yml file to override the command the flight-deck-db container. Optionally, add an environment section to set debug flags as described above.
version: '3'
services:
db:
image: ten7/flight-deck-db:10
command: ["mysqld_safe", "--skip-grant-tables", "--skip-networking"]
environment:
FLIGHTDECK_SKIP_ENTRYPOINT: 1
ANSIBLE_VERBOSITY: 4
Flight Deck is licensed under GPLv3. See LICENSE for the complete language.
Content type
Image
Digest
Size
79.5 MB
Last updated
about 6 years ago
docker pull ten7/flight-deck-db