Merge branch 'master' of github.com:kevinveenbirkenbach/server-playbook

This commit is contained in:
Kevin Veen-Birkenbach 2024-01-04 00:18:50 +01:00
commit 2b96bb254f
110 changed files with 501 additions and 674 deletions

View File

@ -1,9 +1,8 @@
--- ---
# general setup
- name: general setup - name: update device
hosts: all hosts: all
become: true become: true
tasks:
roles: roles:
- role: update - role: update
when: execute_updates | bool when: execute_updates | bool

View File

@ -1,6 +1,7 @@
# General # General
verbose: false # Prints well formated debug information verbose: false # Prints well formated debug information
top_domain: "localhost" top_domain: "localhost"
backups_folder_path: "/Backups/"
# Server Tact Variables # Server Tact Variables
@ -86,6 +87,9 @@ system_maintenance_manipulation_services:
## Total System Maintenance Services ## Total System Maintenance Services
system_maintenance_services: "{{ system_maintenance_backup_services + system_maintenance_cleanup_services + system_maintenance_manipulation_services }}" system_maintenance_services: "{{ system_maintenance_backup_services + system_maintenance_cleanup_services + system_maintenance_manipulation_services }}"
### Define Variables for Docker Volume Health services
whitelisted_anonymous_docker_volumes: []
# Webserver Configuration # Webserver Configuration
## Nginx-Specific Path Configurations ## Nginx-Specific Path Configurations

View File

@ -46,7 +46,6 @@
cmd: "python database_entry_seeder.py databases.csv {{docker_compose_project_name}} {{database_host}} {{database_databasename}} {{database_username}} {{database_password}}" cmd: "python database_entry_seeder.py databases.csv {{docker_compose_project_name}} {{database_host}} {{database_databasename}} {{database_username}} {{database_password}}"
chdir: "{{backup_docker_to_local_folder}}" chdir: "{{backup_docker_to_local_folder}}"
when: > when: >
docker_compose_project_name is defined or
database_host is defined or database_host is defined or
database_databasename is defined or database_databasename is defined or
database_username is defined or database_username is defined or
@ -59,8 +58,7 @@
owner: root owner: root
group: root group: root
when: > when: >
(docker_compose_project_name is defined or (database_host is defined or
database_host is defined or
database_databasename is defined or database_databasename is defined or
database_username is defined or database_username is defined or
database_password is defined) and database_password is defined) and

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,19 +1,13 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
- name: Create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "include tasks update-repository-with-docker-compose.yml" - name: "include tasks update-repository-with-docker-compose.yml"
include_tasks: update-repository-with-docker-compose.yml include_tasks: update-repository-with-docker-compose.yml
- name: configure db.env
template: src=db.env.j2 dest={{docker_compose_instance_directory}}/env/db.env
notify: docker compose project setup
- name: configure run.env - name: configure run.env
template: src=run.env.j2 dest={{docker_compose_instance_directory}}/env/run.env template: src=run.env.j2 dest={{docker_compose_instance_directory}}/env/run.env
notify: docker compose project setup notify: docker compose project setup

View File

@ -1,9 +0,0 @@
# These could be changed
MYSQL_DATABASE={{database_databasename}}
MYSQL_USER={{database_username}}
# This should definitely be changed to something long and random
MYSQL_PASSWORD={{database_password}}
# You should probably leave this
MYSQL_ROOT_PASSWORD={{database_password}}

View File

@ -1,6 +1,9 @@
version: '3.7' version: '3.7'
services: services:
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
application: application:
image: docker.io/akaunting/akaunting:{{version_akaunting}} image: docker.io/akaunting/akaunting:{{version_akaunting}}
build: build:
@ -14,15 +17,10 @@ services:
- env/run.env - env/run.env
environment: environment:
- AKAUNTING_SETUP - AKAUNTING_SETUP
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-networks.yml.j2' %}
depends_on: {% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
- database
{% include 'templates/docker-mariadb-service.yml.j2' %} {% include 'templates/docker-compose-volumes.yml.j2' %}
{% endif %}
volumes:
data: data:
{% if not ( enable_central_database | lower | bool ) %}
database: {% include 'templates/docker-compose-networks.yml.j2' %}
{% endif %}

View File

@ -3,12 +3,12 @@ APP_URL=https://{{domain}}
LOCALE=en-US LOCALE=en-US
# Don't change this unless you rename your database container or use rootless podman, in case of using rootless podman you should set it to 127.0.0.1 (NOT localhost) # Don't change this unless you rename your database container or use rootless podman, in case of using rootless podman you should set it to 127.0.0.1 (NOT localhost)
DB_HOST=akaunting-db DB_HOST={{database_host}}
# Change these to match env/db.env # Change these to match env/db.env
DB_DATABASE=akaunting DB_DATABASE={{database_databasename}}
DB_USERNAME=admin DB_USERNAME={{database_username}}
DB_PASSWORD={{akaunting_database_password}} DB_PASSWORD={{database_password}}
# You should change this to a random string of three numbers or letters followed by an underscore # You should change this to a random string of three numbers or letters followed by an underscore
DB_PREFIX=asd_ DB_PREFIX=asd_

View File

@ -1,9 +1,6 @@
docker_compose_project_name: "akaunting" docker_compose_project_name: "akaunting"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml" docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml"
docker_compose_backup_path: "/tmp/{{docker_compose_project_name}}-docker-compose-backup.yml" docker_compose_backup_path: "/tmp/{{docker_compose_project_name}}-docker-compose-backup.yml"
database_host: "database" database_type: "mariadb"
database_databasename: "{{docker_compose_project_name}}"
database_username: "admin"
database_password: "{{akaunting_database_password}}" database_password: "{{akaunting_database_password}}"
repository_address: "https://github.com/akaunting/docker.git" repository_address: "https://github.com/akaunting/docker.git"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,4 +1,7 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: receive {{ mail_interface_domain }} certificate - name: receive {{ mail_interface_domain }} certificate
command: certbot certonly --agree-tos --email {{ administrator_email }} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{ mail_interface_domain }} command: certbot certonly --agree-tos --email {{ administrator_email }} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{ mail_interface_domain }}
@ -11,10 +14,5 @@
dest: "{{nginx_servers_directory}}{{domain}}.conf" dest: "{{nginx_servers_directory}}{{domain}}.conf"
notify: restart nginx notify: restart nginx
- name: Create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "include tasks update-repository-with-docker-compose.yml" - name: "include tasks update-repository-with-docker-compose.yml"
include_tasks: update-repository-with-docker-compose.yml include_tasks: update-repository-with-docker-compose.yml

View File

@ -1,30 +1,29 @@
version: '3.2' version: '3.2'
services: services:
{% include 'templates/docker-service-redis.yml.j2' %}
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
web: web:
image: attendize_web:latest image: attendize_web:latest
ports: ports:
- "{{http_port}}:80" - "{{http_port}}:80"
#- "8081:443"
volumes: volumes:
- .:/usr/share/nginx/html - .:/usr/share/nginx/html
- .:/var/www - .:/var/www
depends_on: {% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %} maildev:
- database worker:
{% endif %}
- maildev
- redis
- worker
env_file: env_file:
- ./.env - ./.env
{% include 'templates/docker-container-networks.yml.j2' %}
worker: worker:
image: attendize_worker:latest image: attendize_worker:latest
depends_on: {% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %} maildev:
- database {% include 'templates/docker-container-networks.yml.j2' %}
{% endif %}
- maildev
- redis
volumes: volumes:
- .:/usr/share/nginx/html - .:/usr/share/nginx/html
- .:/var/www - .:/var/www
@ -33,18 +32,10 @@ services:
image: maildev/maildev image: maildev/maildev
ports: ports:
- "{{ mail_interface_http_port }}:1080" - "{{ mail_interface_http_port }}:1080"
{% include 'templates/docker-container-networks.yml.j2' %}
{% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
{% include 'templates/docker-redis-service.yml.j2' %} {% include 'templates/docker-compose-volumes.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %}
depends_on:
- database
{% include 'templates/docker-mariadb-service.yml.j2' %}
{% endif %}
volumes:
redis: redis:
{% if not ( enable_central_database | lower | bool ) %}
database: {% include 'templates/docker-compose-networks.yml.j2' %}
{% endif %}

View File

@ -1,11 +1,8 @@
--- ---
docker_compose_project_name: "attendize" docker_compose_project_name: "attendize"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml" docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml"
docker_compose_backup_path: "/tmp/{{docker_compose_project_name}}-docker-compose-backup.yml" docker_compose_backup_path: "/tmp/{{docker_compose_project_name}}-docker-compose-backup.yml"
mail_interface_domain: "mail.{{domain}}" mail_interface_domain: "mail.{{domain}}"
database_host: "database" database_type: "mariadb"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{attendize_database_password}}" database_password: "{{attendize_database_password}}"
repository_address: "https://github.com/Attendize/Attendize.git" repository_address: "https://github.com/Attendize/Attendize.git"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,4 +1,7 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml

View File

@ -1,6 +1,11 @@
version: '2' version: '2'
services: services:
{% include 'templates/docker-service-redis.yml.j2' %}
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
baserow: baserow:
image: baserow/baserow:1.19.1 image: baserow/baserow:1.19.1
restart: always restart: always
@ -12,5 +17,11 @@ services:
- data:/baserow/data - data:/baserow/data
ports: ports:
- "{{http_port}}:80" - "{{http_port}}:80"
volumes: {% include 'templates/docker-container-networks.yml.j2' %}
data: {% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
{% include 'templates/docker-compose-volumes.yml.j2' %}
data:
redis:
{% include 'templates/docker-compose-networks.yml.j2' %}

View File

@ -8,3 +8,13 @@ EMAIL_SMTP_PORT={{ system_email_smtp_port }}
EMAIL_SMTP_USER={{ system_email_username }} EMAIL_SMTP_USER={{ system_email_username }}
EMAIL_SMTP_PASSWORD={{ system_email_password }} EMAIL_SMTP_PASSWORD={{ system_email_password }}
EMAIL_SMTP_USE_TLS={{ system_email_tls | upper }} EMAIL_SMTP_USE_TLS={{ system_email_tls | upper }}
DATABASE_USER={{ database_username }}
DATABASE_NAME={{ database_databasename }}
DATABASE_HOST={{ database_host }}
DATABASE_PORT=5432
DATABASE_PASSWORD={{ database_password }}
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=

View File

@ -1,2 +1,4 @@
docker_compose_project_name: "baserow" docker_compose_project_name: "baserow"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/" database_password: "{{ baserow_database_password }}"
database_version: "{{ baserow_database_version | default(postgres_default_version) }}"
database_type: "postgres"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,4 +1,11 @@
--- ---
- name: include docker vars
include_vars: vars/docker-database-service.yml.j2
- name: load docker compose dependencies
include_role:
name: docker-compose
- name: "include task certbot-matomo.yml" - name: "include task certbot-matomo.yml"
include_tasks: certbot-matomo.yml include_tasks: certbot-matomo.yml

View File

@ -1,6 +1,5 @@
docker_compose_project_name: "bigbluebutton" docker_compose_project_name: "bigbluebutton"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/" database_host: "postgres" # needs to be fixed
database_host: "postgres" database_databasename: "greenlight-v3"
database_databasename: "greenlight-v3" database_username: "postgres"
database_username: "postgres" database_password: ""
database_password: ""

View File

@ -1,2 +0,0 @@
dependencies:
- nginx-docker-reverse-proxy

View File

@ -1,4 +1,7 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
loop: "{{ domains }}" loop: "{{ domains }}"

View File

@ -63,13 +63,21 @@ env:
## TODO: The SMTP mail server used to validate new accounts and send notifications ## TODO: The SMTP mail server used to validate new accounts and send notifications
# SMTP ADDRESS, username, and password are required # SMTP ADDRESS, username, and password are required
# WARNING the char '#' in SMTP password can cause problems! # WARNING the char '#' in SMTP password can cause problems!
DISCOURSE_SMTP_ADDRESS: {{system_email_host}} DISCOURSE_SMTP_ADDRESS: {{ system_email_host }}
DISCOURSE_SMTP_PORT: {{system_email_smtp_port}} DISCOURSE_SMTP_PORT: {{ system_email_smtp_port }}
DISCOURSE_SMTP_USER_NAME: {{system_email}} DISCOURSE_SMTP_USER_NAME: {{ system_email }}
DISCOURSE_SMTP_PASSWORD: {{system_email_password}} DISCOURSE_SMTP_PASSWORD: {{ system_email_password }}
DISCOURSE_SMTP_ENABLE_START_TLS: {{ system_email_start_tls | upper }} DISCOURSE_SMTP_ENABLE_START_TLS: {{ system_email_start_tls | upper }}
DISCOURSE_SMTP_DOMAIN: {{system_email_domain}} DISCOURSE_SMTP_DOMAIN: {{ system_email_domain }}
DISCOURSE_NOTIFICATION_EMAIL: {{system_email}} DISCOURSE_NOTIFICATION_EMAIL: {{ system_email }}
{% if enable_central_database | bool %}
# Database Configuration
DISCOURSE_DB_USERNAME: {{ database_username }}
DISCOURSE_DB_PASSWORD: {{ database_password }}
DISCOURSE_DB_HOST: {{ database_host }}
DISCOURSE_DB_NAME: {{ database_databasename }}
{% if enable_central_database | bool %}
## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate ## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
#LETSENCRYPT_ACCOUNT_EMAIL: administrator@veen.world #LETSENCRYPT_ACCOUNT_EMAIL: administrator@veen.world
@ -85,7 +93,7 @@ env:
## The Docker container is stateless; all data is stored in /shared ## The Docker container is stateless; all data is stored in /shared
volumes: volumes:
- volume: - volume:
host: discourse_application_data host: discourse_data
guest: /shared guest: /shared
- volume: - volume:
host: /var/discourse/shared/standalone/log/var-log host: /var/discourse/shared/standalone/log/var-log

View File

@ -1 +1,4 @@
docker_compose_instance_directory: "{{path_docker_compose_instances}}discourse/" docker_compose_project_name: "attendize"
database_password: "{{ baserow_database_password }}"
database_version: "{{ baserow_database_version | default(postgres_default_version) }}"
database_type: "postgres"

View File

@ -23,8 +23,6 @@ services:
# Use single node discovery in order to disable production mode and avoid bootstrap checks. # Use single node discovery in order to disable production mode and avoid bootstrap checks.
# see: https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html # see: https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
discovery.type: single-node discovery.type: single-node
networks:
- elk
logstash: logstash:
build: build:
@ -47,8 +45,6 @@ services:
- "9600:9600" - "9600:9600"
environment: environment:
LS_JAVA_OPTS: "-Xmx256m -Xms256m" LS_JAVA_OPTS: "-Xmx256m -Xms256m"
networks:
- elk
depends_on: depends_on:
- elasticsearch - elasticsearch
@ -64,14 +60,8 @@ services:
read_only: true read_only: true
ports: ports:
- "127.0.0.1:{{ http_port }}:5601" - "127.0.0.1:{{ http_port }}:5601"
networks:
- elk
depends_on: depends_on:
- elasticsearch - elasticsearch
networks:
elk:
driver: bridge
volumes: volumes:
elasticsearch: elasticsearch:

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,12 +1,10 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
- name: Create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}" - name: "create {{docker_compose_instance_directory}}"
file: file:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"

View File

@ -2,48 +2,41 @@ version: "3"
services: services:
{% include 'templates/docker-redis-service.yml.j2' %} {% include 'templates/docker-service-redis.yml.j2' %}
env_file: .env
celeryworker: celeryworker:
restart: always restart: always
image: funkwhale/api:${FUNKWHALE_VERSION:-latest} image: funkwhale/api:${FUNKWHALE_VERSION:-latest}
depends_on:
{% if not ( enable_central_database | lower | bool ) %}
- postgres
% endif %}
- redis
env_file: .env env_file: .env
command: celery -A funkwhale_api.taskapp worker -l INFO --concurrency=${CELERYD_CONCURRENCY-0} command: celery -A funkwhale_api.taskapp worker -l INFO --concurrency=${CELERYD_CONCURRENCY-0}
environment: environment:
- C_FORCE_ROOT=true - C_FORCE_ROOT=true
volumes: volumes:
- "data:${MEDIA_ROOT}" - "data:${MEDIA_ROOT}"
{% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
{% include 'templates/docker-container-networks.yml.j2' %}
celerybeat: celerybeat:
restart: always restart: always
image: funkwhale/api:${FUNKWHALE_VERSION:-latest} image: funkwhale/api:${FUNKWHALE_VERSION:-latest}
depends_on:
{% if not ( enable_central_database | lower | bool ) %}
- postgres
% endif %}
- redis
env_file: .env env_file: .env
command: celery -A funkwhale_api.taskapp beat --pidfile= -l INFO command: celery -A funkwhale_api.taskapp beat --pidfile= -l INFO
{% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
{% include 'templates/docker-container-networks.yml.j2' %}
api: api:
restart: always restart: always
image: funkwhale/api:${FUNKWHALE_VERSION:-latest} image: funkwhale/api:${FUNKWHALE_VERSION:-latest}
depends_on: depends_on:
- postgres
- redis
env_file: .env env_file: .env
volumes: volumes:
- "data:${MEDIA_ROOT}" - "data:${MEDIA_ROOT}"
#- "${STATIC_ROOT}:${STATIC_ROOT}" #- "${STATIC_ROOT}:${STATIC_ROOT}"
ports: ports:
- "5000" - "5000"
{% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
{% include 'templates/docker-container-networks.yml.j2' %}
front: front:
restart: always restart: always
@ -61,15 +54,10 @@ services:
ports: ports:
# override those variables in your .env file if needed # override those variables in your .env file if needed
- "${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT}:80" - "${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT}:80"
{% include 'templates/docker-container-networks.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-compose-volumes.yml.j2' %}
{% include 'templates/docker-postgres-service.yml.j2' %}
{% endif %}
volumes:
data: data:
redis: redis:
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-compose-networks.yml.j2' %}
database:
{% endif %}

View File

@ -1,7 +1,5 @@
docker_compose_project_name: "funkwhale" docker_compose_project_name: "funkwhale"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
nginx_docker_reverse_proxy_extra_configuration: "client_max_body_size 512M;" nginx_docker_reverse_proxy_extra_configuration: "client_max_body_size 512M;"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{funkwhale_database_password}}" database_password: "{{funkwhale_database_password}}"
database_version: "{{ funkwhale_database_version | default(postgres_default_version) }}" database_version: "{{ funkwhale_database_version | default(postgres_default_version) }}"
database_type: "postgres"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,12 +1,10 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
- name: create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}" - name: "create {{docker_compose_instance_directory}}"
file: file:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"

View File

@ -1,6 +1,9 @@
version: '3' version: '3'
services: services:
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
application: application:
logging: logging:
driver: journald driver: journald
@ -27,20 +30,10 @@ services:
- data:/data - data:/data
- /etc/timezone:/etc/timezone:ro - /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-networks.yml.j2' %}
depends_on: {% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
- database
links:
- database
{% include 'templates/docker-mariadb-service.yml.j2' %}
{% endif %}
volumes: {% include 'templates/docker-compose-volumes.yml.j2' %}
data: data:
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}
networks: {% include 'templates/docker-compose-networks.yml.j2' %}
default:
driver: bridge

View File

@ -1,6 +1,3 @@
docker_compose_project_name: "gitea" docker_compose_project_name: "gitea"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/" database_password: "{{gitea_database_password}}"
database_host: "database" database_type: "mariadb"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{gitea_database_password}}"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,12 +1,10 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
- name: create database in central Postgres
include_role:
name: docker-postgres
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}" - name: "create {{docker_compose_instance_directory}}"
file: file:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"

View File

@ -1,5 +1,10 @@
version: '3.6' version: '3.6'
services: services:
{% include 'templates/docker-service-redis.yml.j2' %}
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
web: web:
image: 'gitlab/gitlab-ee:latest' image: 'gitlab/gitlab-ee:latest'
restart: always restart: always
@ -32,24 +37,13 @@ services:
- 'logs:/var/log/gitlab' - 'logs:/var/log/gitlab'
- 'data:/var/opt/gitlab' - 'data:/var/opt/gitlab'
shm_size: '256m' shm_size: '256m'
depends_on: {% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-networks.yml.j2' %}
database:
condition: service_healthy
{% endif %}
redis:
{% include 'templates/docker-redis-service.yml.j2' %} {% include 'templates/docker-compose-networks.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-compose-volumes.yml.j2' %}
{% include 'templates/docker-postgres-service.yml.j2' %}
{% endif %}
volumes:
redis: redis:
config: config:
logs: logs:
data: data:
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}

View File

@ -1,7 +1,4 @@
docker_compose_project_name: "gitlab" docker_compose_project_name: "gitlab"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
database_host: "database"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{gitlab_database_password}}" database_password: "{{gitlab_database_password}}"
database_version: "{{ gitlab_database_version | default(postgres_default_version) }}" database_version: "{{ gitlab_database_version | default(postgres_default_version) }}"
database_type: "postgres"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,15 +1,13 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
loop: "{{ domains }}" loop: "{{ domains }}"
loop_control: loop_control:
loop_var: domain loop_var: domain
- name: create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}" - name: "create {{docker_compose_instance_directory}}"
file: file:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"

View File

@ -1,6 +1,9 @@
version: '3' version: '3'
services: services:
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
application: application:
image: joomla image: joomla
logging: logging:
@ -11,21 +14,14 @@ services:
JOOMLA_DB_PASSWORD: "{{database_password}}" JOOMLA_DB_PASSWORD: "{{database_password}}"
JOOMLA_DB_NAME: "{{database_databasename}}" JOOMLA_DB_NAME: "{{database_databasename}}"
restart: always restart: always
{% if not ( enable_central_database | lower | bool ) %}
links:
- database
{% endif %}
volumes: volumes:
- data:/var/www/html - data:/var/www/html
ports: ports:
- "127.0.0.1:{{http_port}}:80" - "127.0.0.1:{{http_port}}:80"
{% include 'templates/docker-container-networks.yml.j2' %}
{% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-compose-volumes.yml.j2' %}
{% include 'templates/docker-mariadb-service.yml.j2' %}
{% endif %}
volumes:
data: data:
{% if not ( enable_central_database | lower | bool ) %}
database: {% include 'templates/docker-compose-networks.yml.j2' %}
{% endif %}

View File

@ -1,6 +1,3 @@
docker_compose_project_name: "joomla" docker_compose_project_name: "joomla"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/" database_password: "{{joomla_database_password}}"
database_host: "database" database_type: "postgres"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{joomla_database_password}}"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,12 +1,10 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
- name: create database in central Postgres
include_role:
name: docker-postgres
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}" - name: "create {{docker_compose_instance_directory}}"
file: file:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"

View File

@ -2,6 +2,8 @@ version: "3.7"
services: services:
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
application: application:
restart: unless-stopped restart: unless-stopped
image: listmonk/listmonk:latest image: listmonk/listmonk:latest
@ -11,13 +13,7 @@ services:
- TZ=Etc/UTC - TZ=Etc/UTC
volumes: volumes:
- ./config.toml:/listmonk/config.toml - ./config.toml:/listmonk/config.toml
{% include 'templates/docker-container-networks.yml.j2' %}
{% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-compose-networks.yml.j2' %}
depends_on:
- database
{% include 'templates/docker-postgres-service.yml.j2' %}
volumes:
database:
{% endif %}

View File

@ -1,7 +1,4 @@
docker_compose_project_name: "listmonk" docker_compose_project_name: "listmonk"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
database_host: "database"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{listmonk_database_password}}" database_password: "{{listmonk_database_password}}"
database_version: "{{ listmonk_database_version | default(postgres_default_version) }}" database_version: "{{ listmonk_database_version | default(postgres_default_version) }}"
database_type: "postgres"

View File

@ -1,3 +1,2 @@
dependencies: dependencies:
- docker-compose
- systemd-notifier - systemd-notifier

View File

@ -1,4 +1,7 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
vars: vars:
@ -28,11 +31,6 @@
state: directory state: directory
mode: 0755 mode: 0755
- name: create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: add docker-compose.yml - name: add docker-compose.yml
template: template:
src: "docker-compose.yml.j2" src: "docker-compose.yml.j2"

View File

@ -2,27 +2,16 @@ version: '2.2'
services: services:
{% include 'templates/docker-redis-service.yml.j2' %} {% include 'templates/docker-service-redis.yml.j2' %}
env_file: mailu.env
depends_on: {% include 'templates/docker-service-' + database_type + '.yml.j2' %}
- resolver
dns:
- 192.168.203.254
depends_on:
- resolver
dns:
- 192.168.203.254
networks:
- default
- webmail
- radicale
# Core services # Core services
resolver: resolver:
image: ghcr.io/mailu/unbound:{{version_mailu}} image: ghcr.io/mailu/unbound:{{version_mailu}}
env_file: mailu.env env_file: mailu.env
restart: always restart: always
networks: {% include 'templates/docker-container-networks.yml.j2' %}
default: default:
ipv4_address: 192.168.203.254 ipv4_address: 192.168.203.254
logging: logging:
@ -46,17 +35,13 @@ services:
volumes: volumes:
- "/etc/mailu/overrides/nginx:/overrides:ro" - "/etc/mailu/overrides/nginx:/overrides:ro"
- "/etc/mailu/certs:/certs" - "/etc/mailu/certs:/certs"
depends_on: {% include 'templates/docker-container-depends-on-also-database.yml.j2' %}
resolver: resolver:
condition: service_started condition: service_started
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-networks.yml.j2' %}
database: default:
condition: service_healthy webmail:
{% endif %} radicale:
networks:
- default
- webmail
- radicale
dns: dns:
- 192.168.203.254 - 192.168.203.254
@ -67,17 +52,15 @@ services:
volumes: volumes:
- "admin_data:/data" - "admin_data:/data"
- "dkim:/dkim" - "dkim:/dkim"
depends_on: {% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
- resolver resolver:
- front front:
- redis
{% if not ( enable_central_database | lower | bool ) %}
- database
{% endif %}
logging: logging:
driver: journald driver: journald
dns: dns:
- 192.168.203.254 - 192.168.203.254
{% include 'templates/docker-container-networks.yml.j2' %}
imap: imap:
image: ghcr.io/mailu/dovecot:{{version_mailu}} image: ghcr.io/mailu/dovecot:{{version_mailu}}
restart: always restart: always
@ -92,6 +75,7 @@ services:
- 192.168.203.254 - 192.168.203.254
logging: logging:
driver: journald driver: journald
{% include 'templates/docker-container-networks.yml.j2' %}
smtp: smtp:
image: ghcr.io/mailu/postfix:{{version_mailu}} image: ghcr.io/mailu/postfix:{{version_mailu}}
@ -107,6 +91,7 @@ services:
- 192.168.203.254 - 192.168.203.254
logging: logging:
driver: journald driver: journald
{% include 'templates/docker-container-networks.yml.j2' %}
oletools: oletools:
image: ghcr.io/mailu/oletools:{{version_mailu}} image: ghcr.io/mailu/oletools:{{version_mailu}}
@ -116,8 +101,8 @@ services:
- resolver - resolver
dns: dns:
- 192.168.203.254 - 192.168.203.254
networks: {% include 'templates/docker-container-networks.yml.j2' %}
- noinet noinet:
antispam: antispam:
image: ghcr.io/mailu/rspamd:{{version_mailu}} image: ghcr.io/mailu/rspamd:{{version_mailu}}
@ -134,11 +119,12 @@ services:
- resolver - resolver
dns: dns:
- 192.168.203.254 - 192.168.203.254
networks:
- default
- noinet
logging: logging:
driver: journald driver: journald
{% include 'templates/docker-container-networks.yml.j2' %}
default:
noinet:
# Optional services # Optional services
antivirus: antivirus:
@ -153,6 +139,7 @@ services:
- 192.168.203.254 - 192.168.203.254
logging: logging:
driver: journald driver: journald
{% include 'templates/docker-container-networks.yml.j2' %}
webdav: webdav:
image: ghcr.io/mailu/radicale:{{version_mailu}} image: ghcr.io/mailu/radicale:{{version_mailu}}
@ -168,6 +155,7 @@ services:
- resolver - resolver
dns: dns:
- 192.168.203.254 - 192.168.203.254
{% include 'templates/docker-container-networks.yml.j2' %}
fetchmail: fetchmail:
image: ghcr.io/mailu/fetchmail:{{version_mailu}} image: ghcr.io/mailu/fetchmail:{{version_mailu}}
@ -184,6 +172,7 @@ services:
- resolver - resolver
dns: dns:
- 192.168.203.254 - 192.168.203.254
{% include 'templates/docker-container-networks.yml.j2' %}
webmail: webmail:
image: ghcr.io/mailu/webmail:{{version_mailu}} image: ghcr.io/mailu/webmail:{{version_mailu}}
@ -198,18 +187,12 @@ services:
- resolver - resolver
logging: logging:
driver: journald driver: journald
networks:
- webmail
dns: dns:
- 192.168.203.254 - 192.168.203.254
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-networks.yml.j2' %}
{% include 'templates/docker-postgres-service.yml.j2' %} webmail:
{% endif %}
volumes: {% include 'templates/docker-compose-volumes.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}
smtp_queue: smtp_queue:
admin_data: admin_data:
webdav_data: webdav_data:
@ -218,7 +201,8 @@ volumes:
dkim: dkim:
dovecot_mail: dovecot_mail:
redis: redis:
networks:
{% include 'templates/docker-compose-networks.yml.j2' %}
default: default:
driver: bridge driver: bridge
ipam: ipam:

View File

@ -1,6 +1,2 @@
docker_compose_project_name: "mailu" docker_compose_project_name: "mailu"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
database_host: "database"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{mailu_database_password}}" database_password: "{{mailu_database_password}}"

View File

@ -24,4 +24,4 @@ Configure the role by setting the required variables. These can be set in the pl
- `database_password`: The password for the database user. - `database_password`: The password for the database user.
## Contributing ## Contributing
Contributions to this project are welcome. Please submit issues and pull requests with your suggestions. Contributions to this project are welcome. Please submit issues and pull requests with your suggestions.

View File

@ -1,53 +1,66 @@
- name: Create Docker network for MariaDB - name: Create Docker network for MariaDB
docker_network: docker_network:
name: mariadb_network name: central_mariadb_network
state: present state: present
when: run_once_docker_mariadb is not defined when: run_once_docker_mariadb is not defined
- name: Create a volume for MariaDB socket
docker_volume:
name: mariadb_socket
when: run_once_docker_mariadb is not defined
- name: install MariaDB - name: install MariaDB
docker_container: docker_container:
name: mariadb name: central-mariadb
image: mariadb:latest #could lead to problems with nextcloud image: mariadb:latest #could lead to problems with nextcloud
detach: yes detach: yes
env: env:
MARIADB_ROOT_PASSWORD: "{{central_mariadb_root_password}}" MARIADB_ROOT_PASSWORD: "{{central_mariadb_root_password}}"
MARIADB_AUTO_UPGRADE: "1" MARIADB_AUTO_UPGRADE: "1"
networks: networks:
- name: mariadb_network - name: central_mariadb_network
volumes:
- central_mariadb_database:/var/lib/mysql
published_ports: published_ports:
- "127.0.0.1:3306:3306" - "127.0.0.1:3306:3306" # can be that this will be removed if all applications use sockets
command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW" #for nextcloud command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW" #for nextcloud
when: run_once_docker_mariadb is not defined when: run_once_docker_mariadb is not defined
- name: wait for availability of mariadb - name: install python-mysqlclient
pacman:
name: python-mysqlclient
state: present
when: run_once_docker_mariadb is not defined
- name: wait for database
wait_for: wait_for:
host: "127.0.0.1" host: 127.0.0.1
port: "3306" port: 3306
delay: 0 delay: 10
timeout: 120 timeout: 300
when: run_once_docker_mariadb is not defined when: run_once_docker_mariadb is not defined
- name: create database - name: create database
mysql_db: mysql_db:
name: "{{database_databasename}}" name: "{{ database_databasename }}"
state: present state: present
login_user: root login_user: root
login_password: "{{central_mariadb_root_password}}" login_password: "{{ central_mariadb_root_password }}"
login_host: 127.0.0.1 login_host: 127.0.0.1
login_port: 3306 login_port: 3306
listen: create database
- name: create database user - name: create database user
mysql_user: mysql_user:
name: "{{database_username}}" name: "{{database_username}}"
password: "{{database_password}}" password: "{{database_password}}"
host: "%"
priv: '{{database_databasename}}.*:ALL' priv: '{{database_databasename}}.*:ALL'
state: present state: present
login_user: root login_user: root
login_password: "{{central_mariadb_root_password}}" login_password: "{{central_mariadb_root_password}}"
login_host: 127.0.0.1 login_host: 127.0.0.1
login_port: 3306 login_port: 3306
listen: create database
- name: run the docker_mariadb tasks once - name: run the docker_mariadb tasks once
set_fact: set_fact:

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,15 +1,13 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include create-domains.yml" - name: "include create-domains.yml"
include_tasks: create-domains.yml include_tasks: create-domains.yml
loop: "{{ domains }}" loop: "{{ domains }}"
loop_control: loop_control:
loop_var: domain loop_var: domain
- name: create database in central Postgres
include_role:
name: docker-postgres
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}" - name: "create {{docker_compose_instance_directory}}"
file: file:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"

View File

@ -10,9 +10,11 @@ DB_PORT=5432
DB_NAME={{database_databasename}} DB_NAME={{database_databasename}}
DB_USER={{database_username}} DB_USER={{database_username}}
DB_PASS={{database_password}} DB_PASS={{database_password}}
REDIS_HOST=redis REDIS_HOST=redis
REDIS_PORT=6379 REDIS_PORT=6379
REDIS_PASSWORD= REDIS_PASSWORD=
SMTP_SERVER={{system_email_host}} SMTP_SERVER={{system_email_host}}
SMTP_PORT={{system_email_smtp_port}} SMTP_PORT={{system_email_smtp_port}}
SMTP_LOGIN={{system_email_username}} SMTP_LOGIN={{system_email_username}}

View File

@ -1,83 +1,56 @@
version: '3' version: '3'
services: services:
{% include 'templates/docker-redis-service.yml.j2' %} {% include 'templates/docker-service-redis.yml.j2' %}
networks: {% include 'templates/docker-service-' + database_type + '.yml.j2' %}
- internal_network
web: web:
image: tootsuite/mastodon:{{version_mastodon}} image: tootsuite/mastodon:{{version_mastodon}}
restart: always restart: always
env_file: .env.production env_file: .env.production
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000" command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
networks:
- external_network
- internal_network
healthcheck: healthcheck:
# prettier-ignore
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1'] test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1']
ports: ports:
- "127.0.0.1:{{http_port}}:3000" - "127.0.0.1:{{http_port}}:3000"
depends_on: {% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %}
- database
{% endif %}
- redis
volumes: volumes:
- data:/mastodon/public/system - data:/mastodon/public/system
logging: logging:
driver: journald driver: journald
{% include 'templates/docker-container-networks.yml.j2' %}
streaming: streaming:
image: tootsuite/mastodon:{{version_mastodon}} image: tootsuite/mastodon:{{version_mastodon}}
restart: always restart: always
env_file: .env.production env_file: .env.production
command: node ./streaming command: node ./streaming
networks:
- external_network
- internal_network
healthcheck: healthcheck:
# prettier-ignore
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1'] test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1']
ports: ports:
- "127.0.0.1:{{stream_port}}:4000" - "127.0.0.1:{{stream_port}}:4000"
depends_on: {% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %}
- database
{% endif %}
- redis
logging: logging:
driver: journald driver: journald
{% include 'templates/docker-container-networks.yml.j2' %}
sidekiq: sidekiq:
image: tootsuite/mastodon:{{version_mastodon}} image: tootsuite/mastodon:{{version_mastodon}}
restart: always restart: always
env_file: .env.production env_file: .env.production
command: bundle exec sidekiq command: bundle exec sidekiq
depends_on: {% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %}
- database
{% endif %}
- redis
networks:
- external_network
- internal_network
volumes: volumes:
- data:/mastodon/public/system - data:/mastodon/public/system
healthcheck: healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"] test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
logging: logging:
driver: journald driver: journald
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-networks.yml.j2' %}
{% include 'templates/docker-postgres-service.yml.j2' %}
{% endif %}
volumes: {% include 'templates/docker-compose-volumes.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}
redis: redis:
data: data:
networks:
external_network: {% include 'templates/docker-compose-networks.yml.j2' %}
internal_network:
internal: true

View File

@ -1,7 +1,4 @@
docker_compose_project_name: "mastodon" docker_compose_project_name: "mastodon"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
database_host: "database"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{mastodon_database_password}}" database_password: "{{mastodon_database_password}}"
database_version: "{{ mastodon_database_version | default(postgres_default_version) }}" database_version: "{{ mastodon_database_version | default(postgres_default_version) }}"
database_type: "postgres"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,12 +1,10 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
- name: create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}" - name: "create {{docker_compose_instance_directory}}"
file: file:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"

View File

@ -1,6 +1,9 @@
version: '3' version: '3'
services: services:
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
application: application:
logging: logging:
driver: journald driver: journald
@ -16,17 +19,10 @@ services:
MATOMO_DATABASE_DBNAME: "{{database_databasename}}" MATOMO_DATABASE_DBNAME: "{{database_databasename}}"
volumes: volumes:
- data:/var/www/html - data:/var/www/html
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
depends_on: {% include 'templates/docker-container-networks.yml.j2' %}
- database
{% include 'templates/docker-mariadb-service.yml.j2' %}
{% endif %} {% include 'templates/docker-compose-volumes.yml.j2' %}
volumes:
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}
data: data:
networks:
default: {% include 'templates/docker-compose-networks.yml.j2' %}
driver: bridge

View File

@ -1,7 +1,4 @@
--- ---
docker_compose_project_name: "matomo" docker_compose_project_name: "matomo"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/" database_type: "mariadb"
database_host: "database"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{matomo_database_password}}" database_password: "{{matomo_database_password}}"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,14 +1,12 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
vars: vars:
domain: "{{synapse_domain}}" domain: "{{synapse_domain}}"
http_port: "{{synapse_http_port}}" http_port: "{{synapse_http_port}}"
- name: create database in central Postgres
include_role:
name: docker-postgres
when: enable_central_database | bool
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml

View File

@ -1,7 +1,9 @@
version: '3.1' version: '3.1'
services: services:
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
synapse: synapse:
image: matrixdotorg/synapse:latest image: matrixdotorg/synapse:latest
restart: always restart: always
@ -16,11 +18,8 @@ services:
- SYNAPSE_REPORT_STATS=no - SYNAPSE_REPORT_STATS=no
ports: ports:
- "127.0.0.1:{{synapse_http_port}}:8008" - "127.0.0.1:{{synapse_http_port}}:8008"
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
depends_on: {% include 'templates/docker-container-networks.yml.j2' %}
- database
{% include 'templates/docker-postgres-service.yml.j2' %}
{% endif %}
element: element:
image: vectorim/element-web:latest image: vectorim/element-web:latest
@ -29,6 +28,7 @@ services:
- ./element-config.json:/app/config.json - ./element-config.json:/app/config.json
ports: ports:
- "127.0.0.1:{{element_http_port}}:80" - "127.0.0.1:{{element_http_port}}:80"
{% include 'templates/docker-container-networks.yml.j2' %}
# bridges # bridges
#mautrix-telegram: #mautrix-telegram:
@ -59,15 +59,11 @@ services:
# volumes: # volumes:
# - instagram_bridge_data:/data # - instagram_bridge_data:/data
volumes: {% include 'templates/docker-compose-volumes.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}
synapse_data: synapse_data:
#telegram_bridge_data: #telegram_bridge_data:
#whatsapp_bridge_data: #whatsapp_bridge_data:
#facebook_bridge_data: #facebook_bridge_data:
#instagram_bridge_data: #instagram_bridge_data:
networks:
default: {% include 'templates/docker-compose-networks.yml.j2' %}
driver: bridge

View File

@ -1,7 +1,5 @@
--- ---
docker_compose_project_name: "matrix" docker_compose_project_name: "matrix"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/" database_password: "{{matrix_database_password}}"
database_host: "database" database_version: "{{ baserow_database_version | default(postgres_default_version) }}"
database_databasename: "{{docker_compose_project_name}}" database_type: "postgres"
database_username: "{{docker_compose_project_name}}"
database_password: "{{matrix_database_password}}"

View File

@ -9,7 +9,7 @@
log_driver: journald log_driver: journald
image: mediawiki image: mediawiki
restart: always restart: always
links: depends_on:
- database - database
volumes: volumes:
- "mediawiki-data:/var/www/html/" - "mediawiki-data:/var/www/html/"
@ -20,10 +20,10 @@
image: mariadb image: mariadb
environment: environment:
MYSQL_DATABASE: mediawiki MYSQL_DATABASE: mediawiki
MYSQL_ROOT_PASSWORD: "{{mediawiki_mysql_user_password}}" MYSQL_ROOT_PASSWORD: "{{mediawiki_database_password}}"
MYSQL_USER: mediawiki MYSQL_USER: mediawiki
MYSQL_PASSWORD: "{{mediawiki_mysql_user_password}}" MYSQL_PASSWORD: "{{mediawiki_database_password}}"
MARIADB_AUTO_UPGRADE: "1" MARIADB_AUTO_UPGRADE: "1"
volumes: volumes:
- mediawiki-database:/var/lib/mysql - database:/var/lib/mysql
restart: always restart: always

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,15 +1,13 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks create-proxy-with-domain-replace.yml" - name: "include tasks create-proxy-with-domain-replace.yml"
include_tasks: create-proxy-with-domain-replace.yml include_tasks: create-proxy-with-domain-replace.yml
loop: "{{ domains + [source_domain] }}" loop: "{{ domains + [source_domain] }}"
loop_control: loop_control:
loop_var: domain loop_var: domain
- name: create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "create {{docker_compose_instance_confd_directory}} and parent directories" - name: "create {{docker_compose_instance_confd_directory}} and parent directories"
file: file:
path: "{{docker_compose_instance_confd_directory}}" path: "{{docker_compose_instance_confd_directory}}"

View File

@ -1,5 +1,8 @@
version: '3.8' version: '3.8'
services: services:
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
application: application:
logging: logging:
driver: journald driver: journald
@ -9,10 +12,9 @@ services:
restart: always restart: always
volumes: volumes:
- data:/var/www/html - data:/var/www/html
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
depends_on: {% include 'templates/docker-container-networks.yml.j2' %}
- database
{% endif %}
server: server:
logging: logging:
driver: journald driver: journald
@ -25,16 +27,9 @@ services:
volumes: volumes:
- "{{docker_compose_instance_confd_directory}}:{{target_mount_conf_d_directory}}:ro" - "{{docker_compose_instance_confd_directory}}:{{target_mount_conf_d_directory}}:ro"
- "data:/var/www/html:ro" - "data:/var/www/html:ro"
{% include 'templates/docker-container-networks.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-compose-volumes.yml.j2' %}
{% include 'templates/docker-mariadb-service.yml.j2' %}
{% endif %}
volumes:
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}
data: data:
networks:
default: {% include 'templates/docker-compose-networks.yml.j2' %}
driver: bridge

View File

@ -1,11 +1,8 @@
--- ---
docker_compose_project_name: "mybb" docker_compose_project_name: "mybb"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
docker_compose_instance_confd_directory: "{{docker_compose_instance_directory}}conf.d/" docker_compose_instance_confd_directory: "{{docker_compose_instance_directory}}conf.d/"
docker_compose_instance_confd_defaultconf_file: "{{docker_compose_instance_confd_directory}}default.conf" docker_compose_instance_confd_defaultconf_file: "{{docker_compose_instance_confd_directory}}default.conf"
target_mount_conf_d_directory: "{{nginx_servers_directory}}" target_mount_conf_d_directory: "{{nginx_servers_directory}}"
source_domain: "mybb.{{top_domain}}" source_domain: "mybb.{{top_domain}}"
database_host: "database" database_password: "{{mybb_database_password}}"
database_databasename: "{{docker_compose_project_name}}" database_type: "mariadb"
database_username: "{{docker_compose_project_name}}"
database_password: "{{mybb_database_password}}"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,4 +1,7 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include task certbot-matomo.yml" - name: "include task certbot-matomo.yml"
include_tasks: certbot-matomo.yml include_tasks: certbot-matomo.yml
@ -20,11 +23,6 @@
dest: "{{path_docker_volumes}}nextcloud/nginx.conf" dest: "{{path_docker_volumes}}nextcloud/nginx.conf"
notify: docker compose project setup 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}}" - name: "create {{docker_compose_instance_directory}}"
file: file:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"

View File

@ -1,6 +1,11 @@
version: '3' version: '3'
services: services:
{% include 'templates/docker-service-redis.yml.j2' %}
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
application: application:
image: "nextcloud:{{version_nextcloud}}-fpm-alpine" image: "nextcloud:{{version_nextcloud}}-fpm-alpine"
restart: always restart: always
@ -13,12 +18,8 @@ services:
MYSQL_USER: "{{database_username}}" MYSQL_USER: "{{database_username}}"
MYSQL_PASSWORD: "{{database_password}}" MYSQL_PASSWORD: "{{database_password}}"
MYSQL_HOST: {{database_host}}:3306 MYSQL_HOST: {{database_host}}:3306
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
depends_on: {% include 'templates/docker-container-networks.yml.j2' %}
- database
{% include 'templates/docker-mariadb-service.yml.j2' %}
{% endif %}
web: web:
image: nginx:alpine image: nginx:alpine
@ -27,14 +28,11 @@ services:
restart: always restart: always
ports: ports:
- "127.0.0.1:{{http_port}}:80" - "127.0.0.1:{{http_port}}:80"
depends_on:
- application
volumes: volumes:
- "{{path_docker_volumes}}nextcloud/nginx.conf:/etc/nginx/nginx.conf:ro" - "{{path_docker_volumes}}nextcloud/nginx.conf:/etc/nginx/nginx.conf:ro"
volumes_from: volumes_from:
- application - application
{% include 'templates/docker-container-networks.yml.j2' %}
{% include 'templates/docker-redis-service.yml.j2' %}
cron: cron:
image: "nextcloud:{{version_nextcloud}}-fpm-alpine" image: "nextcloud:{{version_nextcloud}}-fpm-alpine"
@ -44,17 +42,11 @@ services:
volumes: volumes:
- data:/var/www/html - data:/var/www/html
entrypoint: /cron.sh entrypoint: /cron.sh
depends_on: {% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-networks.yml.j2' %}
- database
{% endif %} {% include 'templates/docker-compose-volumes.yml.j2' %}
- redis
volumes:
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}
data: data:
redis: redis:
networks:
default: {% include 'templates/docker-compose-networks.yml.j2' %}
driver: bridge

View File

@ -1,7 +1,4 @@
--- ---
docker_compose_project_name: "nextcloud" docker_compose_project_name: "nextcloud"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/" database_password: "{{nextcloud_database_password}}"
database_host: "database" database_type: "mariadb"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{nextcloud_database_password}}"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,12 +1,10 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
- name: create database in central Postgres
include_role:
name: docker-postgres
when: enable_central_database | bool
- name: "include tasks update-repository-with-docker-compose.yml" - name: "include tasks update-repository-with-docker-compose.yml"
include_tasks: update-repository-with-docker-compose.yml include_tasks: update-repository-with-docker-compose.yml

View File

@ -1,21 +1,8 @@
version: "3.7" version: "3.7"
networks:
frontend:
backend:
volumes:
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}
data:
x-op-restart-policy: &restart_policy
restart: unless-stopped
x-op-image: &image
image: openproject/community:${TAG:-13}
x-op-app: &app x-op-app: &app
<<: [*image, *restart_policy] restart: unless-stopped
image: openproject/community:${TAG:-13}
environment: environment:
OPENPROJECT_HTTPS: "${OPENPROJECT_HTTPS}" OPENPROJECT_HTTPS: "${OPENPROJECT_HTTPS}"
OPENPROJECT_HOST__NAME: "${OPENPROJECT_HOST__NAME}" OPENPROJECT_HOST__NAME: "${OPENPROJECT_HOST__NAME}"
@ -30,26 +17,20 @@ x-op-app: &app
IMAP_ENABLED: "${IMAP_ENABLED:-false}" IMAP_ENABLED: "${IMAP_ENABLED:-false}"
volumes: volumes:
- "data:/var/openproject/assets" - "data:/var/openproject/assets"
{% if not ( enable_central_database | lower | bool ) %} # - "database:/var/openproject/pgdata"
- "database:/var/openproject/pgdata"
{% endif %}
services: services:
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-service-' + database_type + '.yml.j2' %}
{% include 'templates/docker-postgres-service.yml.j2' %}
{% endif %}
networks:
- backend
cache: cache:
image: memcached image: memcached
<<: *restart_policy restart: unless-stopped
networks: {% include 'templates/docker-container-networks.yml.j2' %}
- backend
proxy: proxy:
<<: [*image, *restart_policy] restart: unless-stopped
image: openproject/community:${TAG:-13}
command: "./docker/prod/proxy" command: "./docker/prod/proxy"
ports: ports:
- "${PORT}:80" - "${PORT}:80"
@ -58,26 +39,18 @@ services:
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}" OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
depends_on: depends_on:
- web - web
networks: {% include 'templates/docker-container-networks.yml.j2' %}
- frontend
volumes: volumes:
- "data:/var/openproject/assets" - "data:/var/openproject/assets"
{% if not ( enable_central_database | lower | bool ) %} # - "database:/var/openproject/pgdata" Should definetly not be necessary here
- "database:/var/openproject/pgdata"
{% endif %}
web: web:
<<: *app <<: *app
command: "./docker/prod/web" command: "./docker/prod/web"
networks: {% include 'templates/docker-container-networks.yml.j2' %}
- frontend {% include 'templates/docker-container-depends-on-also-database.yml.j2' %}
- backend cache:
depends_on: seeder:
{% if not ( enable_central_database | lower | bool ) %}
- database
{% endif %}
- cache
- seeder
labels: labels:
- autoheal=true - autoheal=true
healthcheck: healthcheck:
@ -99,30 +72,26 @@ services:
worker: worker:
<<: *app <<: *app
command: "./docker/prod/worker" command: "./docker/prod/worker"
networks: {% include 'templates/docker-container-networks.yml.j2' %}
- backend {% include 'templates/docker-container-depends-on-also-database.yml.j2' %}
depends_on: cache:
{% if not ( enable_central_database | lower | bool ) %} seeder:
- database
{% endif %}
- cache
- seeder
cron: cron:
<<: *app <<: *app
command: "./docker/prod/cron" command: "./docker/prod/cron"
networks: {% include 'templates/docker-container-networks.yml.j2' %}
- backend {% include 'templates/docker-container-depends-on-also-database.yml.j2' %}
depends_on: cache:
{% if not ( enable_central_database | lower | bool ) %} seeder:
- database
{% endif %}
- cache
- seeder
seeder: seeder:
<<: *app <<: *app
command: "./docker/prod/seeder" command: "./docker/prod/seeder"
restart: on-failure restart: on-failure
networks: {% include 'templates/docker-container-networks.yml.j2' %}
- backend
{% include 'templates/docker-compose-networks.yml.j2' %}
{% include 'templates/docker-compose-volumes.yml.j2' %}
data:

View File

@ -3,8 +3,7 @@ repository_directory: "{{ path_docker_compose_instances }}{{docker
docker_compose_instance_directory: "{{repository_directory}}compose/" docker_compose_instance_directory: "{{repository_directory}}compose/"
docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml" docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml"
docker_compose_backup_path: "/tmp/{{docker_compose_project_name}}-docker-compose-backup.yml" docker_compose_backup_path: "/tmp/{{docker_compose_project_name}}-docker-compose-backup.yml"
database_host: "database"
database_databasename: "{{docker_compose_project_name}}"
database_username: "postgres"
database_password: "{{openproject_database_password}}" database_password: "{{openproject_database_password}}"
repository_address: "https://github.com/opf/openproject-deploy" repository_address: "https://github.com/opf/openproject-deploy"
database_version: "{{ openproject_database_version | default(postgres_default_version) }}"
database_type: "postgres"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,15 +1,13 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include create-domains.yml" - name: "include create-domains.yml"
include_tasks: create-domains.yml include_tasks: create-domains.yml
loop: "{{ domains }}" loop: "{{ domains }}"
loop_control: loop_control:
loop_var: domain loop_var: domain
- name: create database in central Postgres
include_role:
name: docker-postgres
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}" - name: "create {{docker_compose_instance_directory}}"
file: file:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"

View File

@ -1,6 +1,11 @@
version: "3.3" version: "3.3"
services: services:
{% include 'templates/docker-service-redis.yml.j2' %}
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
application: application:
image: chocobozzz/peertube:production-bullseye image: chocobozzz/peertube:production-bullseye
env_file: env_file:
@ -13,23 +18,13 @@ services:
- data:/data - data:/data
- config:/config - config:/config
restart: "always" restart: "always"
depends_on: {% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
- redis {% include 'templates/docker-container-networks.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %}
- database
{% include 'templates/docker-postgres-service.yml.j2' %} {% include 'templates/docker-compose-volumes.yml.j2' %}
{% endif %}
{% include 'templates/docker-redis-service.yml.j2' %}
env_file:
- .env
volumes:
assets: assets:
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}
data: data:
redis: redis:
config: config:
{% include 'templates/docker-compose-networks.yml.j2' %}

View File

@ -1,6 +1,3 @@
docker_compose_project_name: "peertube" docker_compose_project_name: "peertube"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/" database_type: "mariadb"
database_host: "database"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{peertube_database_password}}" database_password: "{{peertube_database_password}}"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,12 +1,10 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
- name: create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}" - name: "create {{docker_compose_instance_directory}}"
file: file:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"

View File

@ -1,6 +1,11 @@
version: '2' version: '2'
services: services:
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
{% include 'templates/docker-service-redis.yml.j2' %}
application: application:
image: zknt/pixelfed image: zknt/pixelfed
restart: always restart: always
@ -9,16 +14,13 @@ services:
env_file: env_file:
- ./env - ./env
volumes: volumes:
- "application_data:/var/www/storage" - "data:/var/www/storage"
- "bootstrap:/var/www/bootstrap" - "bootstrap:/var/www/bootstrap"
- "./env:/var/www/.env" - "./env:/var/www/.env"
ports: ports:
- "{{http_port}}:80" - "{{http_port}}:80"
depends_on: {% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-networks.yml.j2' %}
- database
{% endif %}
- redis
worker: worker:
image: zknt/pixelfed image: zknt/pixelfed
restart: always restart: always
@ -27,7 +29,7 @@ services:
env_file: env_file:
- ./env - ./env
volumes: volumes:
- "application_data:/var/www/storage" - "data:/var/www/storage"
- "bootstrap:/var/www/bootstrap" - "bootstrap:/var/www/bootstrap"
- "./env:/var/www/.env" - "./env:/var/www/.env"
entrypoint: /worker-entrypoint.sh entrypoint: /worker-entrypoint.sh
@ -36,22 +38,13 @@ services:
interval: 60s interval: 60s
timeout: 5s timeout: 5s
retries: 1 retries: 1
depends_on: {% include 'templates/docker-container-depends-on-database-redis.yml.j2' %}
- redis application:
- application {% include 'templates/docker-container-networks.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %}
- database
{% include 'templates/docker-mariadb-service.yml.j2' %} {% include 'templates/docker-compose-volumes.yml.j2' %}
{% endif %}
{% include 'templates/docker-redis-service.yml.j2' %}
volumes:
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}
redis: redis:
application_data: data:
bootstrap: bootstrap:
{% include 'templates/docker-compose-networks.yml.j2' %}

View File

@ -1,7 +1,4 @@
docker_compose_project_name: "pixelfed" docker_compose_project_name: "pixelfed"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
nginx_docker_reverse_proxy_extra_configuration: "client_max_body_size 512M;" nginx_docker_reverse_proxy_extra_configuration: "client_max_body_size 512M;"
database_host: "database" database_type: "mariadb"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{pixelfed_database_password}}" database_password: "{{pixelfed_database_password}}"

View File

@ -1,6 +1,6 @@
- name: Create Docker network for PostgreSQL - name: Create Docker network for PostgreSQL
docker_network: docker_network:
name: postgres_network name: central_postgres_network
state: present state: present
when: run_once_docker_postgres is not defined when: run_once_docker_postgres is not defined
@ -13,7 +13,7 @@
POSTGRES_PASSWORD: "{{ central_postgres_password }}" POSTGRES_PASSWORD: "{{ central_postgres_password }}"
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C" # Necessary for docker-matrix POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C" # Necessary for docker-matrix
networks: networks:
- name: postgres_network - name: central_postgres_network
published_ports: published_ports:
- "127.0.0.1:5432:5432" - "127.0.0.1:5432:5432"
when: run_once_docker_postgres is not defined when: run_once_docker_postgres is not defined
@ -34,7 +34,6 @@
login_password: "{{ central_postgres_password }}" login_password: "{{ central_postgres_password }}"
login_host: 127.0.0.1 login_host: 127.0.0.1
login_port: 5432 login_port: 5432
listen: create database
- name: Create database user - name: Create database user
postgresql_user: postgresql_user:
@ -47,7 +46,6 @@
login_password: "{{ central_postgres_password }}" login_password: "{{ central_postgres_password }}"
login_host: 127.0.0.1 login_host: 127.0.0.1
login_port: 5432 login_port: 5432
listen: create database
- name: Run the docker_postgres tasks once - name: Run the docker_postgres tasks once
set_fact: set_fact:

View File

@ -1,3 +1,2 @@
docker_compose_project_name: "roulette-wheel" docker_compose_project_name: "roulette-wheel"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
app_path: "{{docker_compose_instance_directory}}/app/" app_path: "{{docker_compose_instance_directory}}/app/"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,5 +1,7 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
loop: "{{ domains }}" loop: "{{ domains }}"
@ -8,11 +10,6 @@
vars: vars:
nginx_docker_reverse_proxy_extra_configuration: "client_max_body_size {{wordpress_max_upload_size}};" nginx_docker_reverse_proxy_extra_configuration: "client_max_body_size {{wordpress_max_upload_size}};"
- name: create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}" - name: "create {{docker_compose_instance_directory}}"
file: file:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"

View File

@ -17,18 +17,10 @@ services:
WORDPRESS_DB_NAME: "{{database_databasename}}" WORDPRESS_DB_NAME: "{{database_databasename}}"
volumes: volumes:
- data:/var/www/html - data:/var/www/html
{% if not ( enable_central_database | lower | bool ) %} {% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
depends_on: {% include 'templates/docker-container-networks.yml.j2' %}
- database
{% include 'templates/docker-mariadb-service.yml.j2' %} {% include 'templates/docker-compose-networks.yml.j2' %}
{% endif %}
volumes: {% include 'templates/docker-compose-volumes.yml.j2' %}
{% if not ( enable_central_database | lower | bool ) %}
database:
{% endif %}
data: data:
networks:
default:
driver: bridge

View File

@ -1,7 +1,4 @@
docker_compose_project_name: "wordpress" docker_compose_project_name: "wordpress"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
wordpress_max_upload_size: "64M" wordpress_max_upload_size: "64M"
database_host: "database" database_type: "mariadb"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{wordpress_database_password}}" database_password: "{{wordpress_database_password}}"

View File

@ -1,2 +0,0 @@
dependencies:
- docker-compose

View File

@ -1,12 +1,10 @@
--- ---
- name: "include docker-compose-common.yml"
include_tasks: docker-compose-common.yml
- name: "include tasks nginx-docker-proxy-domain.yml" - name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
- name: create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}" - name: "create {{docker_compose_instance_directory}}"
file: file:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"

View File

@ -1,6 +1,9 @@
version: '3' version: '3'
services: services:
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
application: application:
logging: logging:
driver: journald driver: journald
@ -9,22 +12,16 @@ services:
ports: ports:
- "127.0.0.1:{{http_port}}:80" - "127.0.0.1:{{http_port}}:80"
environment: environment:
YOURLS_DB_HOST: "database:3306" YOURLS_DB_HOST: "{{database_host}}"
YOURLS_DB_USER: "yourls" YOURLS_DB_USER: "{{database_username}}"
YOURLS_DB_PASS: "{{yourls_database_password}}" YOURLS_DB_PASS: "{{database_password}}"
YOURLS_DB_NAME: "yourls" YOURLS_DB_NAME: "{{database_databasename}}"
YOURLS_SITE: "https://{{domain}}" YOURLS_SITE: "https://{{domain}}"
YOURLS_USER: "{{yourls_user}}" YOURLS_USER: "{{yourls_user}}"
YOURLS_PASS: "{{yourls_user_password}}" YOURLS_PASS: "{{yourls_user_password}}"
{% if not ( enable_central_database | lower | bool ) %}
depends_on:
- database
{% include 'templates/docker-mariadb-service.yml.j2' %} {% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
{% include 'templates/docker-container-networks.yml.j2' %}
volumes: {% include 'templates/docker-compose-volumes-just-database.yml.j2' %}
database: {% include 'templates/docker-compose-networks.yml.j2' %}
{% endif %}
networks:
default:
driver: bridge

View File

@ -1,6 +1,3 @@
docker_compose_project_name: "yourls" docker_compose_project_name: "yourls"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/" database_type: "mariadb"
database_host: "database"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_password: "{{yourls_database_password}}" database_password: "{{yourls_database_password}}"

View File

@ -4,6 +4,13 @@
notify: restart nginx notify: restart nginx
when: run_once_nginx is not defined when: run_once_nginx is not defined
- name: install nginx-mod-headers-more for matomo
pacman:
name: nginx-mod-headers-more
state: present
notify: restart nginx
when: run_once_nginx is not defined and nginx_matomo_tracking | bool
- name: Ensure nginx configuration directories are present - name: Ensure nginx configuration directories are present
file: file:
path: "{{ item }}" path: "{{ item }}"

View File

@ -1,4 +1,7 @@
{% if nginx_matomo_tracking | bool %}
load_module /usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so; load_module /usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so;
{% endif %}
worker_processes auto; worker_processes auto;
events events

View File

@ -0,0 +1,11 @@
- name: include docker vars
include_vars: vars/docker-database-service.yml.j2
- name: load docker compose dependencies
include_role:
name: docker-compose
- name: create central database
include_role:
name: docker-{{database_type}}
when: enable_central_database | bool

View File

@ -0,0 +1,7 @@
# This template needs to be included in docker-compose.yml
networks:
{% if enable_central_database | bool %}
central_{{ database_type }}_network:
external: true
{% endif %}
{{docker_compose_project_name}}_network:

Some files were not shown because too many files have changed in this diff Show More