Removed server_ for better overview

This commit is contained in:
2023-08-22 22:53:44 +02:00
parent 571bed27a3
commit 4254642313
246 changed files with 45 additions and 45 deletions

View File

@@ -0,0 +1,32 @@
# role server_docker-wordpress
## database
## access database
To access the database execute
```bash
docker exec -it wordpress-database-1 /bin/mysql -u wordpress -p
```
## upgrade database
To upgrade the database execute
```bash
docker exec -it wordpress-database-1 /bin/mysql_upgrade --user=root --password=
```
## change database root password
- https://wolfgang.gassler.org/reset-password-mariadb-mysql-docker/
- https://www.digitalocean.com/community/tutorials/how-to-reset-your-mysql-or-mariadb-root-password
## bash in application
docker exec -it wordpress-application-1 /bin/sh
## update wp-config.php
```bash
apt update && apt install nano && nano wp-config.php
```
## multiside
- https://multilingualpress.de/doku/wordpress-multisite-installieren-einrichten/
- https://pressable.com/knowledgebase/adding-or-changing-the-domain-on-a-wordpress-multisite/
- https://wpengine.com/support/how-to-change-a-multi-site-primary-domain/

View File

@@ -0,0 +1,8 @@
---
- name: recreate wordpress
command:
cmd: docker-compose -p wordpress up -d --force-recreate
chdir: "{{path_docker_compose_files}}wordpress/"
environment:
COMPOSE_HTTP_TIMEOUT: 600
DOCKER_CLIENT_TIMEOUT: 600

View File

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

View File

@@ -0,0 +1,22 @@
---
- name: recieve wordpress certificates
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{item}}
loop: "{{domains}}"
- name: configure wordpress nginx configurations
vars:
client_max_body_size: "2M"
domain: "{{item}}"
template: src=roles/server_native-docker-reverse-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{ item }}.conf
loop: "{{domains}}"
notify: restart nginx
- name: "create {{path_docker_compose_files}}wordpress/"
file:
path: "{{path_docker_compose_files}}wordpress/"
state: directory
mode: 0755
- name: add docker-compose.yml
template: src=docker-compose.yml.j2 dest={{path_docker_compose_files}}wordpress/docker-compose.yml
notify: recreate wordpress

View File

@@ -0,0 +1,45 @@
version: '3'
services:
application:
logging:
driver: journald
image: wordpress
restart: always
ports:
- "127.0.0.1:{{http_port}}:80"
environment:
WORDPRESS_DB_HOST: database:3306
WORDPRESS_DB_USER: "wordpress"
WORDPRESS_DB_PASSWORD: "{{wordpress_database_password}}"
WORDPRESS_DB_NAME: "wordpress"
links:
- database
volumes:
- data:/var/www/html
depends_on:
- database
database:
logging:
driver: journald
image: mariadb
restart: always
environment:
MYSQL_DATABASE: "wordpress"
MYSQL_USER: "wordpress"
MYSQL_PASSWORD: "{{wordpress_database_password}}"
MYSQL_ROOT_PASSWORD: "{{wordpress_database_password}}"
MARIADB_AUTO_UPGRADE: "1"
volumes:
- database:/var/lib/mysql
healthcheck:
test: "/usr/bin/mariadb --user=wordpress --password={{wordpress_database_password}} --execute \"SHOW DATABASES;\""
interval: 3s
timeout: 1s
retries: 5
volumes:
database:
data:
networks:
default:
driver: bridge