mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Removed server_ for better overview
This commit is contained in:
7
roles/docker-mybb/README.md
Normal file
7
roles/docker-mybb/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# role mybb
|
||||
## install plugins
|
||||
Extract the plugins to /mnt.
|
||||
Execute:
|
||||
```bash
|
||||
docker run --rm -v mybb-data:/target/ -v /mnt/:/origin/ "kevinveenbirkenbach/alpine-rsync" sh -c "rsync -avv /origin/inc/plugins/ /target/"
|
||||
```
|
5
roles/docker-mybb/defaults/main.yml
Normal file
5
roles/docker-mybb/defaults/main.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
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"
|
2
roles/docker-mybb/meta/main.yml
Normal file
2
roles/docker-mybb/meta/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
- server_native-docker-reverse-proxy
|
50
roles/docker-mybb/tasks/main.yml
Normal file
50
roles/docker-mybb/tasks/main.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
- name: recieve {{domain}} certificate
|
||||
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
|
||||
|
||||
- name: configure {{domain}}.conf
|
||||
template: src=roles/server_native-docker-reverse-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf
|
||||
notify: restart nginx
|
||||
|
||||
- name: create data folder
|
||||
file:
|
||||
path: "{{conf_d_docker_path}}"
|
||||
state: directory
|
||||
|
||||
- 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
|
32
roles/docker-mybb/templates/default.conf
Normal file
32
roles/docker-mybb/templates/default.conf
Normal file
@@ -0,0 +1,32 @@
|
||||
upstream mybb {
|
||||
server application:9000 weight=5;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
root /var/www/html;
|
||||
index index.html index.php;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
location ~ inc/ {
|
||||
internal;
|
||||
}
|
||||
|
||||
location ~ ^/(images|cache|jscripts|uploads)/ {
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass mybb;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user