mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-25 22:21:04 +01:00
Draft mybb optimation
This commit is contained in:
parent
ffa013aa16
commit
5ca94d6ecc
8
roles/docker-mybb/handlers/main.yml
Normal file
8
roles/docker-mybb/handlers/main.yml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: recreate mybb
|
||||
command:
|
||||
cmd: docker-compose -p mybb up -d --force-recreate
|
||||
chdir: "{{path_docker_compose_files}}mybb/"
|
||||
environment:
|
||||
COMPOSE_HTTP_TIMEOUT: 600
|
||||
DOCKER_CLIENT_TIMEOUT: 600
|
@ -10,41 +10,13 @@
|
||||
file:
|
||||
path: "{{conf_d_docker_path}}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: "create {{default_conf_docker_path}}"
|
||||
template: src="default.conf" dest="{{default_conf_docker_path}}"
|
||||
|
||||
- name: "setup mybb"
|
||||
docker_compose:
|
||||
project_name: mybb
|
||||
definition:
|
||||
application:
|
||||
log_driver: journald
|
||||
image: mybb/mybb:latest
|
||||
restart: always
|
||||
links:
|
||||
- database
|
||||
volumes:
|
||||
- mybb-data:/var/www/html
|
||||
server:
|
||||
log_driver: journald
|
||||
links:
|
||||
- application
|
||||
image: nginx:mainline
|
||||
restart: always
|
||||
ports:
|
||||
- "127.0.0.1:{{http_port}}:80"
|
||||
volumes:
|
||||
- "{{conf_d_docker_path}}:{{conf_d_path}}"
|
||||
- "mybb-data:/var/www/html:ro"
|
||||
database:
|
||||
log_driver: journald
|
||||
image: mariadb
|
||||
environment:
|
||||
MYSQL_DATABASE: "mybb"
|
||||
MYSQL_USER: "mybb"
|
||||
MYSQL_PASSWORD: "{{mybb_database_password}}"
|
||||
MARIADB_AUTO_UPGRADE: "1"
|
||||
volumes:
|
||||
- mybb-database:/var/lib/mysql
|
||||
restart: always
|
||||
- name: add docker-compose.yml
|
||||
template:
|
||||
src: "docker-compose.yml.j2"
|
||||
dest: "{{docker_compose_instance_directory}}docker-compose.yml"
|
||||
notify: recreate matomo
|
||||
|
42
roles/docker-mybb/templates/docker-compose.yml.j2
Normal file
42
roles/docker-mybb/templates/docker-compose.yml.j2
Normal file
@ -0,0 +1,42 @@
|
||||
services:
|
||||
application:
|
||||
log_driver: journald
|
||||
image: mybb/mybb:latest
|
||||
restart: always
|
||||
links:
|
||||
- database
|
||||
volumes:
|
||||
- mybb-data:/var/www/html
|
||||
server:
|
||||
log_driver: journald
|
||||
links:
|
||||
- application
|
||||
image: nginx:mainline
|
||||
restart: always
|
||||
ports:
|
||||
- "127.0.0.1:{{http_port}}:80"
|
||||
volumes:
|
||||
- "{{conf_d_docker_path}}:{{conf_d_path}}"
|
||||
- "mybb-data:/var/www/html:ro"
|
||||
database:
|
||||
log_driver: journald
|
||||
image: mariadb
|
||||
environment:
|
||||
MYSQL_DATABASE: "mybb"
|
||||
MYSQL_USER: "mybb"
|
||||
MYSQL_PASSWORD: "{{mybb_database_password}}"
|
||||
MARIADB_AUTO_UPGRADE: "1"
|
||||
volumes:
|
||||
- database:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: "/usr/bin/mariadb --user=mybb --password={{mybb_database_password}} --execute \"SHOW DATABASES;\""
|
||||
interval: 3s
|
||||
timeout: 1s
|
||||
retries: 5
|
||||
restart: always
|
||||
volumes:
|
||||
database:
|
||||
data:
|
||||
networks:
|
||||
default:
|
||||
driver: bridge
|
@ -1,5 +1,6 @@
|
||||
---
|
||||
docker_compose_instance_directory: "{{path_docker_compose_files}}mybb/"
|
||||
conf_d_path: "/etc/nginx/conf.d/"
|
||||
#default_conf_path: "/etc/nginx/nginx.conf"
|
||||
conf_d_docker_path: "/etc/docker/applications/mybb{{conf_d_path}}"
|
||||
default_conf_docker_path: "{{conf_d_docker_path}}default.conf"
|
||||
|
Loading…
Reference in New Issue
Block a user