mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-12-23 02:45:02 +01:00
26 lines
901 B
Django/Jinja
26 lines
901 B
Django/Jinja
# This template needs to be included in docker-compose.yml, which depend on a mariadb database
|
|
{% if not enable_central_database | bool %}
|
|
database:
|
|
container_name: {{docker_compose_project_name}}-database
|
|
logging:
|
|
driver: journald
|
|
image: mariadb
|
|
restart: {{docker_restart_policy}}
|
|
environment:
|
|
MYSQL_DATABASE: "{{database_name}}"
|
|
MYSQL_USER: "{{database_username}}"
|
|
MYSQL_PASSWORD: "{{database_password}}"
|
|
MYSQL_ROOT_PASSWORD: "{{database_password}}"
|
|
MARIADB_AUTO_UPGRADE: "1"
|
|
command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW"
|
|
volumes:
|
|
- database:/var/lib/mysql
|
|
healthcheck:
|
|
test: "/usr/bin/mariadb --user={{database_username}} --password={{database_password}} --execute \"SHOW DATABASES;\""
|
|
interval: 3s
|
|
timeout: 1s
|
|
retries: 5
|
|
networks:
|
|
- default
|
|
{% endif %}
|
|
{{ "\n" }} |