mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-21 20:31:02 +01:00
Added draft for central postgres and mariadb. variables and networks still need to be adapted
This commit is contained in:
parent
658e40098a
commit
20a4e628e9
@ -96,6 +96,9 @@ nginx_upstreams_directory: "{{nginx_configuration_directory}}upstreams/"
|
|||||||
|
|
||||||
## Docker Applications
|
## Docker Applications
|
||||||
|
|
||||||
|
### Enable Central MariaDB
|
||||||
|
enable_central_database: true
|
||||||
|
|
||||||
### Domain Names for Various Services
|
### Domain Names for Various Services
|
||||||
domain_akaunting: "akaunting.{{top_domain}}"
|
domain_akaunting: "akaunting.{{top_domain}}"
|
||||||
domain_baserow: "baserow.{{top_domain}}"
|
domain_baserow: "baserow.{{top_domain}}"
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
- 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
|
||||||
|
|
||||||
|
@ -14,11 +14,15 @@ services:
|
|||||||
- env/run.env
|
- env/run.env
|
||||||
environment:
|
environment:
|
||||||
- AKAUNTING_SETUP
|
- AKAUNTING_SETUP
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
- database
|
||||||
|
|
||||||
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
data:
|
data:
|
||||||
database:
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
|
database:
|
||||||
|
{% endif %}
|
@ -11,5 +11,10 @@
|
|||||||
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
|
@ -9,7 +9,9 @@ services:
|
|||||||
- .:/usr/share/nginx/html
|
- .:/usr/share/nginx/html
|
||||||
- .:/var/www
|
- .:/var/www
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- database
|
- database
|
||||||
|
{% endif %}
|
||||||
- maildev
|
- maildev
|
||||||
- redis
|
- redis
|
||||||
- worker
|
- worker
|
||||||
@ -18,15 +20,15 @@ services:
|
|||||||
worker:
|
worker:
|
||||||
image: attendize_worker:latest
|
image: attendize_worker:latest
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- database
|
- database
|
||||||
|
{% endif %}
|
||||||
- maildev
|
- maildev
|
||||||
- redis
|
- redis
|
||||||
volumes:
|
volumes:
|
||||||
- .:/usr/share/nginx/html
|
- .:/usr/share/nginx/html
|
||||||
- .:/var/www
|
- .:/var/www
|
||||||
|
|
||||||
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
|
||||||
|
|
||||||
maildev:
|
maildev:
|
||||||
image: maildev/maildev
|
image: maildev/maildev
|
||||||
ports:
|
ports:
|
||||||
@ -34,6 +36,15 @@ services:
|
|||||||
|
|
||||||
{% include 'templates/docker-redis-service.yml.j2' %}
|
{% include 'templates/docker-redis-service.yml.j2' %}
|
||||||
|
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
|
depends_on:
|
||||||
|
- database
|
||||||
|
|
||||||
|
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
redis:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
redis:
|
{% endif %}
|
@ -2,6 +2,11 @@
|
|||||||
- 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}}"
|
||||||
|
@ -1,14 +1,6 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
|
||||||
restart: always
|
|
||||||
env_file: .env
|
|
||||||
environment:
|
|
||||||
- "POSTGRES_HOST_AUTH_METHOD=trust"
|
|
||||||
image: postgres:15-alpine
|
|
||||||
volumes:
|
|
||||||
- database:/var/lib/postgresql/data
|
|
||||||
|
|
||||||
{% include 'templates/docker-redis-service.yml.j2' %}
|
{% include 'templates/docker-redis-service.yml.j2' %}
|
||||||
|
|
||||||
@ -18,7 +10,9 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
image: funkwhale/api:${FUNKWHALE_VERSION:-latest}
|
image: funkwhale/api:${FUNKWHALE_VERSION:-latest}
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- postgres
|
- postgres
|
||||||
|
% endif %}
|
||||||
- redis
|
- 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}
|
||||||
@ -31,7 +25,9 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
image: funkwhale/api:${FUNKWHALE_VERSION:-latest}
|
image: funkwhale/api:${FUNKWHALE_VERSION:-latest}
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- postgres
|
- postgres
|
||||||
|
% endif %}
|
||||||
- redis
|
- 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
|
||||||
@ -65,7 +61,15 @@ 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"
|
||||||
|
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
|
{% include 'templates/docker-postgres-service.yml.j2' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
database:
|
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
|
database:
|
||||||
|
{% endif %}
|
@ -1,3 +1,7 @@
|
|||||||
docker_compose_project_name: "funkwhale"
|
docker_compose_project_name: "funkwhale"
|
||||||
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
|
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_version: "{{ funkwhale_database_version | default(postgres_default_version) }}"
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
- 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}}"
|
||||||
|
@ -23,20 +23,24 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:{{http_port}}:3000"
|
- "127.0.0.1:{{http_port}}:3000"
|
||||||
- "{{ssh_port}}:22"
|
- "{{ssh_port}}:22"
|
||||||
links:
|
|
||||||
- database
|
|
||||||
volumes:
|
volumes:
|
||||||
- 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 ) %}
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
- database
|
||||||
|
links:
|
||||||
|
- database
|
||||||
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
database:
|
|
||||||
data:
|
data:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
|
database:
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
- 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}}"
|
||||||
|
@ -33,17 +33,23 @@ services:
|
|||||||
- 'data:/var/opt/gitlab'
|
- 'data:/var/opt/gitlab'
|
||||||
shm_size: '256m'
|
shm_size: '256m'
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
{% endif %}
|
||||||
redis:
|
redis:
|
||||||
|
|
||||||
{% include 'templates/docker-postgres-service.yml.j2' %}
|
|
||||||
|
|
||||||
{% include 'templates/docker-redis-service.yml.j2' %}
|
{% include 'templates/docker-redis-service.yml.j2' %}
|
||||||
|
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
|
{% include 'templates/docker-postgres-service.yml.j2' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
database:
|
redis:
|
||||||
config:
|
config:
|
||||||
logs:
|
logs:
|
||||||
data:
|
data:
|
||||||
redis:
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
|
database:
|
||||||
|
{% endif %}
|
||||||
|
1
roles/docker-jenkins/README.md
Normal file
1
roles/docker-jenkins/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
This role is deprecated. Needs to be reimplemented.
|
@ -5,6 +5,11 @@
|
|||||||
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}}"
|
||||||
|
@ -11,15 +11,21 @@ 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:
|
links:
|
||||||
- database
|
- 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"
|
||||||
|
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
data:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
data:
|
{% endif %}
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
- 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}}"
|
||||||
|
@ -2,8 +2,6 @@ version: "3.7"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
{% include 'templates/docker-postgres-service.yml.j2' %}
|
|
||||||
|
|
||||||
application:
|
application:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: listmonk/listmonk:latest
|
image: listmonk/listmonk:latest
|
||||||
@ -11,10 +9,15 @@ services:
|
|||||||
- "127.0.0.1:{{http_port}}:9000"
|
- "127.0.0.1:{{http_port}}:9000"
|
||||||
environment:
|
environment:
|
||||||
- TZ=Etc/UTC
|
- TZ=Etc/UTC
|
||||||
depends_on:
|
|
||||||
- database
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.toml:/listmonk/config.toml
|
- ./config.toml:/listmonk/config.toml
|
||||||
|
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
|
depends_on:
|
||||||
|
- database
|
||||||
|
|
||||||
|
{% include 'templates/docker-postgres-service.yml.j2' %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
database:
|
database:
|
||||||
|
{% endif %}
|
@ -28,6 +28,11 @@
|
|||||||
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"
|
||||||
|
@ -3,15 +3,11 @@ version: '2.2'
|
|||||||
services:
|
services:
|
||||||
|
|
||||||
{% include 'templates/docker-redis-service.yml.j2' %}
|
{% include 'templates/docker-redis-service.yml.j2' %}
|
||||||
|
|
||||||
env_file: mailu.env
|
env_file: mailu.env
|
||||||
depends_on:
|
depends_on:
|
||||||
- resolver
|
- resolver
|
||||||
dns:
|
dns:
|
||||||
- 192.168.203.254
|
- 192.168.203.254
|
||||||
|
|
||||||
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- resolver
|
- resolver
|
||||||
dns:
|
dns:
|
||||||
@ -53,8 +49,10 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
resolver:
|
resolver:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
{% endif %}
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
- webmail
|
- webmail
|
||||||
@ -73,7 +71,9 @@ services:
|
|||||||
- resolver
|
- resolver
|
||||||
- front
|
- front
|
||||||
- redis
|
- redis
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- database
|
- database
|
||||||
|
{% endif %}
|
||||||
logging:
|
logging:
|
||||||
driver: journald
|
driver: journald
|
||||||
dns:
|
dns:
|
||||||
@ -202,9 +202,14 @@ services:
|
|||||||
- webmail
|
- webmail
|
||||||
dns:
|
dns:
|
||||||
- 192.168.203.254
|
- 192.168.203.254
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
|
{% include 'templates/docker-postgres-service.yml.j2' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
|
{% endif %}
|
||||||
smtp_queue:
|
smtp_queue:
|
||||||
admin_data:
|
admin_data:
|
||||||
webdav_data:
|
webdav_data:
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
- name: create database
|
|
||||||
mysql_db:
|
|
||||||
name: "{{database_databasename}}"
|
|
||||||
state: present
|
|
||||||
login_user: root
|
|
||||||
login_password: "{{central_mariadb_root_password}}"
|
|
||||||
login_host: 127.0.0.1
|
|
||||||
login_port: 3306
|
|
||||||
listen: create database
|
|
||||||
|
|
||||||
- name: create database user
|
|
||||||
mysql_user:
|
|
||||||
name: "{{database_username}}"
|
|
||||||
password: "{{database_password}}"
|
|
||||||
priv: '{{database_databasename}}.*:ALL'
|
|
||||||
state: present
|
|
||||||
login_user: root
|
|
||||||
login_password: "{{central_mariadb_root_password}}"
|
|
||||||
login_host: 127.0.0.1
|
|
||||||
login_port: 3306
|
|
||||||
listen: create database
|
|
@ -7,16 +7,48 @@
|
|||||||
- name: install MariaDB
|
- name: install MariaDB
|
||||||
docker_container:
|
docker_container:
|
||||||
name: mariadb
|
name: mariadb
|
||||||
image: mariadb:latest
|
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"
|
||||||
networks:
|
networks:
|
||||||
- name: mariadb_network
|
- name: mariadb_network
|
||||||
published_ports:
|
published_ports:
|
||||||
- "127.0.0.1:3306:3306"
|
- "127.0.0.1:3306:3306"
|
||||||
|
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
|
||||||
|
wait_for:
|
||||||
|
host: "127.0.0.1"
|
||||||
|
port: "3306"
|
||||||
|
delay: 0
|
||||||
|
timeout: 120
|
||||||
|
when: run_once_docker_mariadb is not defined
|
||||||
|
|
||||||
|
- name: create database
|
||||||
|
mysql_db:
|
||||||
|
name: "{{database_databasename}}"
|
||||||
|
state: present
|
||||||
|
login_user: root
|
||||||
|
login_password: "{{central_mariadb_root_password}}"
|
||||||
|
login_host: 127.0.0.1
|
||||||
|
login_port: 3306
|
||||||
|
listen: create database
|
||||||
|
|
||||||
|
- name: create database user
|
||||||
|
mysql_user:
|
||||||
|
name: "{{database_username}}"
|
||||||
|
password: "{{database_password}}"
|
||||||
|
priv: '{{database_databasename}}.*:ALL'
|
||||||
|
state: present
|
||||||
|
login_user: root
|
||||||
|
login_password: "{{central_mariadb_root_password}}"
|
||||||
|
login_host: 127.0.0.1
|
||||||
|
login_port: 3306
|
||||||
|
listen: create database
|
||||||
|
|
||||||
- name: run the docker_mariadb tasks once
|
- name: run the docker_mariadb tasks once
|
||||||
set_fact:
|
set_fact:
|
||||||
run_once_docker_mariadb: true
|
run_once_docker_mariadb: true
|
||||||
|
@ -5,6 +5,11 @@
|
|||||||
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}}"
|
||||||
|
@ -1,19 +1,5 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
database:
|
|
||||||
restart: always
|
|
||||||
image: postgres:14-alpine
|
|
||||||
shm_size: 256mb
|
|
||||||
networks:
|
|
||||||
- internal_network
|
|
||||||
healthcheck:
|
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
|
||||||
volumes:
|
|
||||||
- database:/var/lib/postgresql/data
|
|
||||||
environment:
|
|
||||||
- 'POSTGRES_HOST_AUTH_METHOD=trust'
|
|
||||||
logging:
|
|
||||||
driver: journald
|
|
||||||
|
|
||||||
{% include 'templates/docker-redis-service.yml.j2' %}
|
{% include 'templates/docker-redis-service.yml.j2' %}
|
||||||
|
|
||||||
@ -34,7 +20,9 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:{{http_port}}:3000"
|
- "127.0.0.1:{{http_port}}:3000"
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- database
|
- database
|
||||||
|
{% endif %}
|
||||||
- redis
|
- redis
|
||||||
volumes:
|
volumes:
|
||||||
- data:/mastodon/public/system
|
- data:/mastodon/public/system
|
||||||
@ -54,7 +42,9 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:{{stream_port}}:4000"
|
- "127.0.0.1:{{stream_port}}:4000"
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- database
|
- database
|
||||||
|
{% endif %}
|
||||||
- redis
|
- redis
|
||||||
logging:
|
logging:
|
||||||
driver: journald
|
driver: journald
|
||||||
@ -64,7 +54,9 @@ services:
|
|||||||
env_file: .env.production
|
env_file: .env.production
|
||||||
command: bundle exec sidekiq
|
command: bundle exec sidekiq
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- database
|
- database
|
||||||
|
{% endif %}
|
||||||
- redis
|
- redis
|
||||||
networks:
|
networks:
|
||||||
- external_network
|
- external_network
|
||||||
@ -75,8 +67,14 @@ services:
|
|||||||
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-postgres-service.yml.j2' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
|
{% endif %}
|
||||||
redis:
|
redis:
|
||||||
data:
|
data:
|
||||||
networks:
|
networks:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
docker_compose_project_name: "mastodon"
|
docker_compose_project_name: "mastodon"
|
||||||
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
|
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
|
||||||
database_host: "database"
|
database_host: "database"
|
||||||
database_databasename: "postgres" # todo: Change this to standart name scheme for future setups
|
database_databasename: "{{docker_compose_project_name}}"
|
||||||
database_username: "postgres" # todo: Change this to standart name scheme for future setups
|
database_username: "{{docker_compose_project_name}}"
|
||||||
database_password: "" # todo: Change this to standart name scheme for future setups
|
database_password: "{{mastodon_database_password}}"
|
||||||
|
database_version: "{{ mastodon_database_version | default(postgres_default_version) }}"
|
@ -2,6 +2,11 @@
|
|||||||
- 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}}"
|
||||||
|
@ -14,17 +14,18 @@ services:
|
|||||||
MATOMO_DATABASE_USERNAME: "{{database_username}}"
|
MATOMO_DATABASE_USERNAME: "{{database_username}}"
|
||||||
MATOMO_DATABASE_PASSWORD: "{{database_password}}"
|
MATOMO_DATABASE_PASSWORD: "{{database_password}}"
|
||||||
MATOMO_DATABASE_DBNAME: "{{database_databasename}}"
|
MATOMO_DATABASE_DBNAME: "{{database_databasename}}"
|
||||||
links:
|
|
||||||
- database
|
|
||||||
depends_on:
|
|
||||||
- database
|
|
||||||
volumes:
|
volumes:
|
||||||
- data:/var/www/html
|
- data:/var/www/html
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
|
depends_on:
|
||||||
|
- database
|
||||||
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
volumes:
|
volumes:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
|
{% endif %}
|
||||||
data:
|
data:
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
@ -4,6 +4,11 @@
|
|||||||
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
|
||||||
|
@ -16,25 +16,12 @@ 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 ) %}
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
- database
|
||||||
database:
|
{% include 'templates/docker-postgres-service.yml.j2' %}
|
||||||
logging:
|
{% endif %}
|
||||||
driver: journald
|
|
||||||
image: postgres:16
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- database:/var/lib/postgresql/data
|
|
||||||
environment:
|
|
||||||
- POSTGRES_DB={{database_databasename}}
|
|
||||||
- POSTGRES_USER={{database_username}}
|
|
||||||
- POSTGRES_PASSWORD={{database_password}}
|
|
||||||
- POSTGRES_INITDB_ARGS=--encoding=UTF8 --locale=C
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "pg_isready -U {{database_username}}"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 6
|
|
||||||
element:
|
element:
|
||||||
image: vectorim/element-web:latest
|
image: vectorim/element-web:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@ -73,7 +60,9 @@ services:
|
|||||||
# - instagram_bridge_data:/data
|
# - instagram_bridge_data:/data
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
|
{% endif %}
|
||||||
synapse_data:
|
synapse_data:
|
||||||
#telegram_bridge_data:
|
#telegram_bridge_data:
|
||||||
#whatsapp_bridge_data:
|
#whatsapp_bridge_data:
|
||||||
|
@ -5,6 +5,11 @@
|
|||||||
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}}"
|
||||||
|
@ -7,17 +7,17 @@ services:
|
|||||||
tag: "mybb_application"
|
tag: "mybb_application"
|
||||||
image: mybb/mybb:latest
|
image: mybb/mybb:latest
|
||||||
restart: always
|
restart: always
|
||||||
links:
|
|
||||||
- database
|
|
||||||
volumes:
|
volumes:
|
||||||
- data:/var/www/html
|
- data:/var/www/html
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
|
depends_on:
|
||||||
|
- database
|
||||||
|
{% endif %}
|
||||||
server:
|
server:
|
||||||
logging:
|
logging:
|
||||||
driver: journald
|
driver: journald
|
||||||
options:
|
options:
|
||||||
tag: "mybb_server"
|
tag: "mybb_server"
|
||||||
links:
|
|
||||||
- application
|
|
||||||
image: nginx:mainline
|
image: nginx:mainline
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
@ -26,10 +26,14 @@ services:
|
|||||||
- "{{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"
|
||||||
|
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
|
{% endif %}
|
||||||
data:
|
data:
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
@ -20,6 +20,11 @@
|
|||||||
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}}"
|
||||||
|
@ -6,8 +6,6 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
logging:
|
logging:
|
||||||
driver: journald
|
driver: journald
|
||||||
depends_on:
|
|
||||||
- database
|
|
||||||
volumes:
|
volumes:
|
||||||
- data:/var/www/html
|
- data:/var/www/html
|
||||||
environment:
|
environment:
|
||||||
@ -15,25 +13,13 @@ 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
|
||||||
database:
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
logging:
|
depends_on:
|
||||||
driver: journald
|
- database
|
||||||
image: mariadb:10.5
|
|
||||||
command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW"
|
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
||||||
environment:
|
{% endif %}
|
||||||
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
|
|
||||||
web:
|
web:
|
||||||
image: nginx:alpine
|
image: nginx:alpine
|
||||||
logging:
|
logging:
|
||||||
@ -59,10 +45,14 @@ services:
|
|||||||
- data:/var/www/html
|
- data:/var/www/html
|
||||||
entrypoint: /cron.sh
|
entrypoint: /cron.sh
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- database
|
- database
|
||||||
|
{% endif %}
|
||||||
- redis
|
- redis
|
||||||
volumes:
|
volumes:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
|
{% endif %}
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
networks:
|
networks:
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
- 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
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ networks:
|
|||||||
backend:
|
backend:
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
pgdata:
|
database:
|
||||||
opdata:
|
data:
|
||||||
|
|
||||||
x-op-restart-policy: &restart_policy
|
x-op-restart-policy: &restart_policy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@ -15,8 +15,8 @@ x-op-image: &image
|
|||||||
x-op-app: &app
|
x-op-app: &app
|
||||||
<<: [*image, *restart_policy]
|
<<: [*image, *restart_policy]
|
||||||
environment:
|
environment:
|
||||||
OPENPROJECT_HTTPS: "${OPENPROJECT_HTTPS:-true}"
|
OPENPROJECT_HTTPS: "${OPENPROJECT_HTTPS}"
|
||||||
OPENPROJECT_HOST__NAME: "${OPENPROJECT_HOST__NAME:-localhost:8080}"
|
OPENPROJECT_HOST__NAME: "${OPENPROJECT_HOST__NAME}"
|
||||||
OPENPROJECT_HSTS: "${OPENPROJECT_HSTS:-true}"
|
OPENPROJECT_HSTS: "${OPENPROJECT_HSTS:-true}"
|
||||||
RAILS_CACHE_STORE: "memcache"
|
RAILS_CACHE_STORE: "memcache"
|
||||||
OPENPROJECT_CACHE__MEMCACHE__SERVER: "cache:11211"
|
OPENPROJECT_CACHE__MEMCACHE__SERVER: "cache:11211"
|
||||||
@ -27,19 +27,14 @@ x-op-app: &app
|
|||||||
# set to true to enable the email receiving feature. See ./docker/cron for more options
|
# set to true to enable the email receiving feature. See ./docker/cron for more options
|
||||||
IMAP_ENABLED: "${IMAP_ENABLED:-false}"
|
IMAP_ENABLED: "${IMAP_ENABLED:-false}"
|
||||||
volumes:
|
volumes:
|
||||||
- "${OPDATA}:/var/openproject/assets"
|
- "data:/var/openproject/assets"
|
||||||
- "${PGDATA}:/var/openproject/pgdata"
|
- "database:/var/openproject/pgdata"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
database:
|
|
||||||
image: postgres:13
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
<<: *restart_policy
|
{% include 'templates/docker-postgres-service.yml.j2' %}
|
||||||
stop_grace_period: "3s"
|
{% endif %}
|
||||||
volumes:
|
|
||||||
- "${PGDATA}:/var/lib/postgresql/data"
|
|
||||||
environment:
|
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
||||||
POSTGRES_DB: openproject
|
|
||||||
networks:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
@ -53,7 +48,7 @@ services:
|
|||||||
<<: [*image, *restart_policy]
|
<<: [*image, *restart_policy]
|
||||||
command: "./docker/prod/proxy"
|
command: "./docker/prod/proxy"
|
||||||
ports:
|
ports:
|
||||||
- "${PORT:-8080}:80"
|
- "${PORT}:80"
|
||||||
environment:
|
environment:
|
||||||
APP_HOST: web
|
APP_HOST: web
|
||||||
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
|
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
|
||||||
@ -62,8 +57,8 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- frontend
|
- frontend
|
||||||
volumes:
|
volumes:
|
||||||
- "${OPDATA}:/var/openproject/assets"
|
- "data:/var/openproject/assets"
|
||||||
- "${PGDATA}:/var/openproject/pgdata"
|
- "database:/var/openproject/pgdata"
|
||||||
|
|
||||||
web:
|
web:
|
||||||
<<: *app
|
<<: *app
|
||||||
@ -72,7 +67,9 @@ services:
|
|||||||
- frontend
|
- frontend
|
||||||
- backend
|
- backend
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- database
|
- database
|
||||||
|
{% endif %}
|
||||||
- cache
|
- cache
|
||||||
- seeder
|
- seeder
|
||||||
labels:
|
labels:
|
||||||
@ -99,7 +96,9 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- database
|
- database
|
||||||
|
{% endif %}
|
||||||
- cache
|
- cache
|
||||||
- seeder
|
- seeder
|
||||||
|
|
||||||
@ -109,7 +108,9 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- database
|
- database
|
||||||
|
{% endif %}
|
||||||
- cache
|
- cache
|
||||||
- seeder
|
- seeder
|
||||||
|
|
||||||
|
@ -15,7 +15,4 @@ IMAP_ENABLED=false
|
|||||||
POSTGRES_PASSWORD="{{ database_password }}"
|
POSTGRES_PASSWORD="{{ database_password }}"
|
||||||
DATABASE_URL="postgres://{{ database_username }}:{{ database_password }}@{{database_host}}/{{database_databasename}}?pool=20&encoding=unicode&reconnect=true"
|
DATABASE_URL="postgres://{{ database_username }}:{{ database_password }}@{{database_host}}/{{database_databasename}}?pool=20&encoding=unicode&reconnect=true"
|
||||||
RAILS_MIN_THREADS=4
|
RAILS_MIN_THREADS=4
|
||||||
RAILS_MAX_THREADS=16
|
RAILS_MAX_THREADS=16
|
||||||
|
|
||||||
PGDATA="pgdata"
|
|
||||||
OPDATA="opdata"
|
|
@ -4,7 +4,12 @@
|
|||||||
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}}"
|
||||||
|
@ -12,22 +12,14 @@ services:
|
|||||||
- assets:/app/client/dist
|
- assets:/app/client/dist
|
||||||
- data:/data
|
- data:/data
|
||||||
- config:/config
|
- config:/config
|
||||||
|
restart: "always"
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
|
||||||
- redis
|
- redis
|
||||||
restart: "always"
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
- database
|
||||||
image: postgres:13-alpine
|
|
||||||
env_file:
|
{% include 'templates/docker-postgres-service.yml.j2' %}
|
||||||
- .env
|
{% endif %}
|
||||||
volumes:
|
|
||||||
- database:/var/lib/postgresql/data
|
|
||||||
restart: "always"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "pg_isready -U peertube"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 6
|
|
||||||
|
|
||||||
{% include 'templates/docker-redis-service.yml.j2' %}
|
{% include 'templates/docker-redis-service.yml.j2' %}
|
||||||
|
|
||||||
@ -35,7 +27,9 @@ services:
|
|||||||
- .env
|
- .env
|
||||||
volumes:
|
volumes:
|
||||||
assets:
|
assets:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
|
{% endif %}
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
config:
|
config:
|
@ -1,7 +1,12 @@
|
|||||||
---
|
---
|
||||||
- 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}}"
|
||||||
|
@ -15,7 +15,9 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "{{http_port}}:80"
|
- "{{http_port}}:80"
|
||||||
depends_on:
|
depends_on:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- database
|
- database
|
||||||
|
{% endif %}
|
||||||
- redis
|
- redis
|
||||||
worker:
|
worker:
|
||||||
image: zknt/pixelfed
|
image: zknt/pixelfed
|
||||||
@ -29,22 +31,27 @@ services:
|
|||||||
- "bootstrap:/var/www/bootstrap"
|
- "bootstrap:/var/www/bootstrap"
|
||||||
- "./env:/var/www/.env"
|
- "./env:/var/www/.env"
|
||||||
entrypoint: /worker-entrypoint.sh
|
entrypoint: /worker-entrypoint.sh
|
||||||
depends_on:
|
|
||||||
- database
|
|
||||||
- redis
|
|
||||||
- application
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: php artisan horizon:status | grep running
|
test: php artisan horizon:status | grep running
|
||||||
interval: 60s
|
interval: 60s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 1
|
retries: 1
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
- application
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
|
|
||||||
|
- database
|
||||||
|
|
||||||
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% include 'templates/docker-redis-service.yml.j2' %}
|
{% include 'templates/docker-redis-service.yml.j2' %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
|
{% endif %}
|
||||||
redis:
|
redis:
|
||||||
application_data:
|
application_data:
|
||||||
bootstrap:
|
bootstrap:
|
@ -56,17 +56,11 @@ MAIL_ENCRYPTION=tls
|
|||||||
|
|
||||||
## Databases (MySQL)
|
## Databases (MySQL)
|
||||||
DB_CONNECTION=mysql
|
DB_CONNECTION=mysql
|
||||||
DB_DATABASE=pixelfed
|
DB_DATABASE={{database_databasename}}
|
||||||
DB_HOST=database
|
DB_HOST={{database_host}}
|
||||||
DB_PASSWORD="{{pixelfed_database_password}}"
|
DB_PASSWORD="{{pixelfed_database_password}}"
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
DB_USERNAME=pixelfed
|
DB_USERNAME={{database_username}}
|
||||||
# pass the same values to the db itself
|
|
||||||
MYSQL_DATABASE="pixelfed"
|
|
||||||
MYSQL_USER="pixelfed"
|
|
||||||
MYSQL_PASSWORD="{{pixelfed_database_password}}"
|
|
||||||
MYSQL_ROOT_PASSWORD="{{pixelfed_database_password}}"
|
|
||||||
MARIADB_AUTO_UPGRADE="1"
|
|
||||||
|
|
||||||
## Cache (Redis)
|
## Cache (Redis)
|
||||||
REDIS_CLIENT=phpredis
|
REDIS_CLIENT=phpredis
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
- name: Create database
|
|
||||||
postgresql_db:
|
|
||||||
name: "{{ database_databasename }}"
|
|
||||||
state: present
|
|
||||||
login_user: postgres
|
|
||||||
login_password: "{{ central_postgres_password }}"
|
|
||||||
login_host: 127.0.0.1
|
|
||||||
login_port: 5432
|
|
||||||
listen: create database
|
|
||||||
|
|
||||||
- name: Create database user
|
|
||||||
postgresql_user:
|
|
||||||
name: "{{ database_username }}"
|
|
||||||
password: "{{ database_password }}"
|
|
||||||
db: "{{ database_databasename }}"
|
|
||||||
priv: ALL
|
|
||||||
state: present
|
|
||||||
login_user: postgres
|
|
||||||
login_password: "{{ central_postgres_password }}"
|
|
||||||
login_host: 127.0.0.1
|
|
||||||
login_port: 5432
|
|
||||||
listen: create database
|
|
@ -11,12 +11,44 @@
|
|||||||
detach: yes
|
detach: yes
|
||||||
env:
|
env:
|
||||||
POSTGRES_PASSWORD: "{{ central_postgres_password }}"
|
POSTGRES_PASSWORD: "{{ central_postgres_password }}"
|
||||||
|
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C" # Necessary for docker-matrix
|
||||||
networks:
|
networks:
|
||||||
- name: postgres_network
|
- name: 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
|
||||||
|
|
||||||
|
- name: wait for availability of postgres
|
||||||
|
wait_for:
|
||||||
|
host: "127.0.0.1"
|
||||||
|
port: "5432"
|
||||||
|
delay: 0
|
||||||
|
timeout: 120
|
||||||
|
when: run_once_docker_postgres is not defined
|
||||||
|
|
||||||
|
- name: Create database
|
||||||
|
postgresql_db:
|
||||||
|
name: "{{ database_databasename }}"
|
||||||
|
state: present
|
||||||
|
login_user: postgres
|
||||||
|
login_password: "{{ central_postgres_password }}"
|
||||||
|
login_host: 127.0.0.1
|
||||||
|
login_port: 5432
|
||||||
|
listen: create database
|
||||||
|
|
||||||
|
- name: Create database user
|
||||||
|
postgresql_user:
|
||||||
|
name: "{{ database_username }}"
|
||||||
|
password: "{{ database_password }}"
|
||||||
|
db: "{{ database_databasename }}"
|
||||||
|
priv: ALL
|
||||||
|
state: present
|
||||||
|
login_user: postgres
|
||||||
|
login_password: "{{ central_postgres_password }}"
|
||||||
|
login_host: 127.0.0.1
|
||||||
|
login_port: 5432
|
||||||
|
listen: create database
|
||||||
|
|
||||||
- name: Run the docker_postgres tasks once
|
- name: Run the docker_postgres tasks once
|
||||||
set_fact:
|
set_fact:
|
||||||
run_once_docker_postgres: true
|
run_once_docker_postgres: true
|
||||||
|
@ -8,6 +8,11 @@
|
|||||||
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}}"
|
||||||
|
@ -15,17 +15,19 @@ services:
|
|||||||
WORDPRESS_DB_USER: "{{database_username}}"
|
WORDPRESS_DB_USER: "{{database_username}}"
|
||||||
WORDPRESS_DB_PASSWORD: "{{database_password}}"
|
WORDPRESS_DB_PASSWORD: "{{database_password}}"
|
||||||
WORDPRESS_DB_NAME: "{{database_databasename}}"
|
WORDPRESS_DB_NAME: "{{database_databasename}}"
|
||||||
links:
|
|
||||||
- database
|
|
||||||
volumes:
|
volumes:
|
||||||
- data:/var/www/html
|
- data:/var/www/html
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
- database
|
||||||
|
|
||||||
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
database:
|
database:
|
||||||
|
{% endif %}
|
||||||
data:
|
data:
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
- 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}}"
|
||||||
|
@ -16,30 +16,15 @@ services:
|
|||||||
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}}"
|
||||||
links:
|
{% if not ( enable_central_database | lower | bool ) %}
|
||||||
- database
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
- database
|
||||||
database:
|
|
||||||
logging:
|
{% include 'templates/docker-mariadb-service.yml.j2' %}
|
||||||
driver: journald
|
|
||||||
image: mariadb
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
MYSQL_DATABASE: "yourls"
|
|
||||||
MYSQL_USER: "yourls"
|
|
||||||
MYSQL_PASSWORD: "{{yourls_database_password}}"
|
|
||||||
MYSQL_ROOT_PASSWORD: "{{yourls_database_password}}"
|
|
||||||
MARIADB_AUTO_UPGRADE: "1"
|
|
||||||
volumes:
|
|
||||||
- database:/var/lib/mysql
|
|
||||||
healthcheck:
|
|
||||||
test: "/usr/bin/mariadb --user=yourls --password={{yourls_database_password}} --execute \"SHOW DATABASES;\""
|
|
||||||
interval: 3s
|
|
||||||
timeout: 1s
|
|
||||||
retries: 5
|
|
||||||
volumes:
|
volumes:
|
||||||
database:
|
database:
|
||||||
|
{% endif %}
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
MYSQL_PASSWORD: "{{database_password}}"
|
MYSQL_PASSWORD: "{{database_password}}"
|
||||||
MYSQL_ROOT_PASSWORD: "{{database_password}}"
|
MYSQL_ROOT_PASSWORD: "{{database_password}}"
|
||||||
MARIADB_AUTO_UPGRADE: "1"
|
MARIADB_AUTO_UPGRADE: "1"
|
||||||
|
command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW"
|
||||||
volumes:
|
volumes:
|
||||||
- database:/var/lib/mysql
|
- database:/var/lib/mysql
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
- POSTGRES_PASSWORD={{database_password}}
|
- POSTGRES_PASSWORD={{database_password}}
|
||||||
- POSTGRES_USER={{database_username}}
|
- POSTGRES_USER={{database_username}}
|
||||||
- POSTGRES_DB={{database_databasename}}
|
- POSTGRES_DB={{database_databasename}}
|
||||||
|
- POSTGRES_INITDB_ARGS="--encoding=UTF8 --locale=C"
|
||||||
restart: always
|
restart: always
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U {{database_databasename}}"]
|
test: ["CMD-SHELL", "pg_isready -U {{database_databasename}}"]
|
||||||
|
Loading…
Reference in New Issue
Block a user