2024-01-03 11:38:09 +01:00
|
|
|
# This template needs to be included in docker-compose.yml, which depend on a mariadb database
|
2024-01-03 12:07:19 +01:00
|
|
|
{% if not enable_central_database | bool %}
|
2023-12-26 03:13:16 +01:00
|
|
|
database:
|
2024-01-09 18:16:53 +01:00
|
|
|
container_name: {{docker_compose_project_name}}-database
|
2023-12-26 03:13:16 +01:00
|
|
|
logging:
|
|
|
|
driver: journald
|
|
|
|
image: mariadb
|
2024-01-12 20:57:58 +01:00
|
|
|
restart: {{docker_restart_policy}}
|
2023-12-26 03:13:16 +01:00
|
|
|
environment:
|
2024-01-06 14:32:49 +01:00
|
|
|
MYSQL_DATABASE: "{{database_name}}"
|
2023-12-26 03:13:16 +01:00
|
|
|
MYSQL_USER: "{{database_username}}"
|
|
|
|
MYSQL_PASSWORD: "{{database_password}}"
|
|
|
|
MYSQL_ROOT_PASSWORD: "{{database_password}}"
|
|
|
|
MARIADB_AUTO_UPGRADE: "1"
|
2023-12-31 11:14:18 +01:00
|
|
|
command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW"
|
2023-12-26 03:13:16 +01:00
|
|
|
volumes:
|
|
|
|
- database:/var/lib/mysql
|
|
|
|
healthcheck:
|
|
|
|
test: "/usr/bin/mariadb --user={{database_username}} --password={{database_password}} --execute \"SHOW DATABASES;\""
|
|
|
|
interval: 3s
|
|
|
|
timeout: 1s
|
2024-01-02 21:13:34 +01:00
|
|
|
retries: 5
|
|
|
|
networks:
|
2024-01-05 20:22:34 +01:00
|
|
|
- default
|
2024-01-04 10:15:46 +01:00
|
|
|
{% endif %}
|
2024-01-04 11:36:55 +01:00
|
|
|
{{ "\n" }}
|