computer-playbook/templates/docker-service-mariadb.yml.j2

23 lines
748 B
Plaintext
Raw Normal View History

{% if not enable_central_database %}
database:
logging:
driver: journald
image: mariadb
restart: always
environment:
MYSQL_DATABASE: "{{database_databasename}}"
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:
- {{docker_compose_project_name}}_network
{% endif %}