From 69c8db6f5577918b9f95bcd77cc7b02bb7d1e501 Mon Sep 17 00:00:00 2001 From: Lars Klemstein Date: Fri, 14 Nov 2025 16:38:54 +0100 Subject: [PATCH] initial_commit --- .gitignore | 2 ++ docker-compose.yml | 51 +++++++++++++++++++++++++++++++++++++++++ nginx-config/nginx.conf | 49 +++++++++++++++++++++++++++++++++++++++ tools/inst_plugins.sh | 16 +++++++++++++ 4 files changed, 118 insertions(+) create mode 100644 .gitignore create mode 100644 docker-compose.yml create mode 100644 nginx-config/nginx.conf create mode 100755 tools/inst_plugins.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fa806b2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +wordpress/ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ce95f1f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,51 @@ +--- +name: tt_coaching_20251114 + +services: + wordpress: + user: "0:0" + cap_add: + - NET_ADMIN + command: ["/usr/local/bin/start.sh"] + image: wordpress:6.8.3-php8.4-fpm-alpine-customized + build: + context: docker_files/wordpress + container_name: tt_coaching_20251114-wordpress + restart: unless-stopped + env_file: .env + environment: + WORDPRESS_DB_HOST: "$MYSQL_DB_HOST" + WORDPRESS_DB_USER: "$MYSQL_USER" + WORDPRESS_DB_PASSWORD: "$MYSQL_PASSWORD" + WORDPRESS_DB_NAME: "$MYSQL_DATABASE" + WORDPRESS_SKIP_INSTALL: "true" + volumes: + - ./wordpress:/var/www/html + - ./docker_files/wordpress/start.sh:/usr/local/bin/start.sh:ro + networks: + - 01_tt_coaching_20251114_wordpress-app + - wordpress-db + webserver: + image: nginx:1.29.3-alpine + container_name: tt_coaching_20251114-nginx + restart: unless-stopped + ports: + - "127.0.0.1:13029:80" + volumes: + - ./wordpress:/var/www/html + - ./nginx-config:/etc/nginx/conf.d + networks: + - 01_tt_coaching_20251114_wordpress-app + redis: + image: redis:7-alpine + container_name: tt_coaching_20251114-wordpress-redis + restart: always + command: redis-server --save "" --appendonly no + networks: + - 01_tt_coaching_20251114_wordpress-app + +networks: + 01_tt_coaching_20251114_wordpress-app: + external: true + wordpress-db: + external: true diff --git a/nginx-config/nginx.conf b/nginx-config/nginx.conf new file mode 100644 index 0000000..1a45b48 --- /dev/null +++ b/nginx-config/nginx.conf @@ -0,0 +1,49 @@ +server { + listen 80; + listen [::]:80; + + server_name coaching.tanjathomsen.de; + + index index.php index.html index.htm; + + client_max_body_size 64M; + + root /var/www/html; + + location / { + try_files $uri $uri/ /index.php$is_args$args; + + } + + location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass wordpress:9000; + fastcgi_index index.php; + include fastcgi_params; + + # Absolute path fixes 'Primary script unknown' / 'file not found' issues + fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + + # Optional but helps debugging + fastcgi_read_timeout 300; + fastcgi_buffering off; + } + + location ~ /\.ht { + deny all; + } + + location = /favicon.ico { + log_not_found off; access_log off; + } + + location = /robots.txt { + log_not_found off; access_log off; allow all; + } + + location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ { + expires max; + log_not_found off; + } +} diff --git a/tools/inst_plugins.sh b/tools/inst_plugins.sh new file mode 100755 index 0000000..f2b3dfa --- /dev/null +++ b/tools/inst_plugins.sh @@ -0,0 +1,16 @@ + +#!/bin/bash + +set -euo pipefail + +dc_wp() { + docker compose exec -u www-data wordpress wp $@ +} + +dc_wp plugin install redis-cache --activate +dc_wp redis enable + +dc_wp plugin install wp-mail-smtp --activate + +echo "Done." >&2 +