Added draft for central postgres and mariadb. variables and networks still need to be adapted

This commit is contained in:
2023-12-31 11:14:18 +01:00
parent 3fa052f71d
commit a112b67eda
48 changed files with 340 additions and 213 deletions

View File

@@ -20,6 +20,11 @@
dest: "{{path_docker_volumes}}nextcloud/nginx.conf"
notify: docker compose project setup
- name: create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}"
file:
path: "{{docker_compose_instance_directory}}"

View File

@@ -6,8 +6,6 @@ services:
restart: always
logging:
driver: journald
depends_on:
- database
volumes:
- data:/var/www/html
environment:
@@ -15,25 +13,13 @@ services:
MYSQL_USER: "{{database_username}}"
MYSQL_PASSWORD: "{{database_password}}"
MYSQL_HOST: {{database_host}}:3306
database:
logging:
driver: journald
image: mariadb:10.5
command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW"
environment:
MYSQL_DATABASE: "{{database_databasename}}"
MYSQL_USER: "{{database_username}}"
MYSQL_PASSWORD: "{{database_password}}"
MYSQL_ROOT_PASSWORD: "{{database_password}}"
MARIADB_AUTO_UPGRADE: "1"
volumes:
- database:/var/lib/mysql
restart: always
healthcheck:
test: "/usr/bin/mariadb --user={{database_username}} --password={{database_password}} --execute \"SHOW DATABASES;\""
interval: 3s
timeout: 1s
retries: 5
{% if not ( enable_central_database | lower | bool ) %}
depends_on:
- database
{% include 'templates/docker-mariadb-service.yml.j2' %}
{% endif %}
web:
image: nginx:alpine
logging:
@@ -59,10 +45,14 @@ services:
- data:/var/www/html
entrypoint: /cron.sh
depends_on:
{% if not ( enable_central_database | lower | bool ) %}
- database
{% endif %}
- redis
volumes:
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}
data:
redis:
networks: