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

@@ -5,27 +5,12 @@ services:
image: docker.io/bitnami/moodle:{{applications.moodle.version}}
ports:
- 127.0.0.1:{{http_port}}:8080
restart: {{docker_restart_policy}}
logging:
driver: journald
environment:
- MOODLE_DATABASE_HOST={{database_host}}
- MOODLE_DATABASE_PORT_NUMBER={{database_port}}
- MOODLE_DATABASE_USER={{database_username}}
- MOODLE_DATABASE_NAME={{database_name}}
- MOODLE_DATABASE_PASSWORD={{database_password}}
- ALLOW_EMPTY_PASSWORD=no
- MOODLE_SITE_NAME="{{applications.moodle.site_titel}}"
- MOODLE_SSLPROXY=yes
- MOODLE_REVERSE_PROXY=yes
- MOODLE_USERNAME={{applications.moodle.administrator_name}}
- MOODLE_PASSWORD={{moodle_user_password}}
- MOODLE_EMAIL={{applications.moodle.administrator_email}}
- BITNAMI_DEBUG={% if mode_debug | bool %}true{% else %}false{% endif %}
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
volumes:
- 'moodle:/bitnami/moodle'
- 'data:/bitnami/moodledata'
# Healthcheck is not possible due to missing curl and wget in container
# @todo implement healthcheck
# healthcheck:
# test: ["CMD", "curl", "-f", "http://127.0.0.1:8080"]
# interval: 1m

View File

@@ -0,0 +1,13 @@
MOODLE_DATABASE_HOST={{database_host}}
MOODLE_DATABASE_PORT_NUMBER={{database_port}}
MOODLE_DATABASE_USER={{database_username}}
MOODLE_DATABASE_NAME={{database_name}}
MOODLE_DATABASE_PASSWORD={{database_password}}
ALLOW_EMPTY_PASSWORD=no
MOODLE_SITE_NAME="{{applications.moodle.site_titel}}"
MOODLE_SSLPROXY=yes
MOODLE_REVERSE_PROXY=yes
MOODLE_USERNAME={{applications.moodle.administrator_name}}
MOODLE_PASSWORD={{moodle_user_password}}
MOODLE_EMAIL={{applications.moodle.administrator_email}}
BITNAMI_DEBUG={% if mode_debug | bool %}true{% else %}false{% endif %}