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

@@ -18,10 +18,18 @@
dest: "{{docker_compose.directories.volumes}}nginx.conf"
notify: docker compose project setup
- name: add 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: docker-compose.yml.j2
dest: "{{docker_compose.directories.instance}}docker-compose.yml"
src: "env.j2"
dest: "{{docker_compose.files.env}}"
mode: '770'
force: yes
notify: docker compose project setup
# @todo activate

View File

@@ -7,34 +7,9 @@ services:
application:
image: "nextcloud:{{applications.nextcloud.version}}-fpm-alpine"
container_name: {{nextcloud_application_container_name}}
restart: {{docker_restart_policy}}
logging:
driver: journald
volumes:
- data:/var/www/html
environment:
# See https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html
# Database Configuration
MYSQL_DATABASE: "{{database_name}}"
MYSQL_USER: "{{database_username}}"
MYSQL_PASSWORD: "{{database_password}}"
MYSQL_HOST: "{{database_host}}:{{database_port}}"
# Memory
PHP_MEMORY_LIMIT: 1G # Required for plugin duplicate finder
# Email Configuration
SMTP_HOST: {{system_email.host}}
SMTP_SECURE: {{ 'ssl' if system_email.tls else '' }}
SMTP_PORT: {{system_email.smtp_port}}
SMTP_NAME: {{system_email.username}}
SMTP_PASSWORD: {{system_email.password}}
# Email from configuration
MAIL_FROM_ADDRESS: no-reply
MAIL_DOMAIN: {{system_email.domain}}
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
{% include 'templates/docker/container/depends-on-database-redis.yml.j2' %}
{% include 'templates/docker/container/networks.yml.j2' %}

View File

@@ -0,0 +1,21 @@
# See https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html
# Database Configuration
MYSQL_DATABASE= "{{database_name}}"
MYSQL_USER= "{{database_username}}"
MYSQL_PASSWORD= "{{database_password}}"
MYSQL_HOST= "{{database_host}}:{{database_port}}"
# Memory
PHP_MEMORY_LIMIT= 1G # Required for plugin duplicate finder
# Email Configuration
SMTP_HOST= {{system_email.host}}
SMTP_SECURE= {{ 'ssl' if system_email.tls else '' }}
SMTP_PORT= {{system_email.smtp_port}}
SMTP_NAME= {{system_email.username}}
SMTP_PASSWORD= {{system_email.password}}
# Email from configuration
MAIL_FROM_ADDRESS= no-reply
MAIL_DOMAIN= {{system_email.domain}}