Implemented a new docker compose structure which seperates between docker compose files and environment variable file to protect credentials better. Also did recatoring. Changes not fully tested

This commit is contained in:
2025-02-04 22:37:07 +01:00
parent 5503326ea6
commit e50fd54f4e
85 changed files with 610 additions and 515 deletions

View File

@@ -6,8 +6,16 @@
- name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml
- name: add docker-compose.yml
template:
src: "docker-compose.yml.j2"
dest: "{{docker_compose.directories.instance}}docker-compose.yml"
- name: "create {{docker_compose.files.docker_compose}}"
template:
src: "docker-compose.yml.j2"
dest: "{{docker_compose.files.docker_compose}}"
notify: docker compose project setup
- name: "create {{docker_compose.files.env}}"
template:
src: "env.j2"
dest: "{{docker_compose.files.env}}"
mode: '770'
force: yes
notify: docker compose project setup

View File

@@ -3,18 +3,10 @@ services:
{% include 'roles/docker-central-database/templates/services/' + database_type + '.yml.j2' %}
application:
logging:
driver: journald
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
image: matomo:{{applications.matomo.version}}
restart: {{docker_restart_policy}}
ports:
- "127.0.0.1:{{http_port}}:80"
environment:
MATOMO_DATABASE_HOST: "{{database_host}}:{{database_port}}"
MATOMO_DATABASE_ADAPTER: "mysql"
MATOMO_DATABASE_USERNAME: "{{database_username}}"
MATOMO_DATABASE_PASSWORD: "{{database_password}}"
MATOMO_DATABASE_DBNAME: "{{database_name}}"
volumes:
- data:/var/www/html
{% include 'templates/docker/container/depends-on-just-database.yml.j2' %}

View File

@@ -0,0 +1,5 @@
MATOMO_DATABASE_HOST= "{{database_host}}:{{database_port}}"
MATOMO_DATABASE_ADAPTER= "mysql"
MATOMO_DATABASE_USERNAME= "{{database_username}}"
MATOMO_DATABASE_PASSWORD= "{{database_password}}"
MATOMO_DATABASE_DBNAME= "{{database_name}}"