From 8f740f225139335bb4b409d545fd374ee78d143d Mon Sep 17 00:00:00 2001 From: Lars Klemstein Date: Thu, 20 Nov 2025 22:25:00 +0100 Subject: [PATCH] initial version (of an old wp instance...) --- .gitignore | 3 +++ docker-compose.yml | 39 +++++++++++++++++++++++++++++ nginx-config/http_password.dat | 1 + nginx-config/nginx.conf | 45 ++++++++++++++++++++++++++++++++++ wp_install.txt | 3 +++ 5 files changed, 91 insertions(+) create mode 100644 .gitignore create mode 100644 docker-compose.yml create mode 100644 nginx-config/http_password.dat create mode 100644 nginx-config/nginx.conf create mode 100644 wp_install.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d4a18e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +wordpress/ +.env +httppasswd.txt diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5487302 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,39 @@ +--- +services: + wordpress: + image: wordpress:6.8.3-php8.4-fpm-alpine + build: + context: docker_files/wordpress + container_name: fotoistin_20251103-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 + networks: + - wordpress + - wordpress-db + webserver: + depends_on: + - wordpress + image: nginx:1.29.3-alpine + container_name: fotoistin_20251103-nginx + restart: unless-stopped + ports: + - "127.0.0.1:13025:80" + volumes: + - ./wordpress:/var/www/html + - ./nginx-config:/etc/nginx/conf.d + networks: + - wordpress + +networks: + wordpress: + driver: bridge + wordpress-db: + external: true diff --git a/nginx-config/http_password.dat b/nginx-config/http_password.dat new file mode 100644 index 0000000..641f5cb --- /dev/null +++ b/nginx-config/http_password.dat @@ -0,0 +1 @@ +gate:$2b$12$MjzirA7j.wRrLPIvRuNMVevcC4Tao5s12InEfRcP4i.m5SPeRKXwS diff --git a/nginx-config/nginx.conf b/nginx-config/nginx.conf new file mode 100644 index 0000000..dd2ab8e --- /dev/null +++ b/nginx-config/nginx.conf @@ -0,0 +1,45 @@ +server { + listen 80; + listen [::]:80; + + server_name staging.fotoistin.de; + + index index.php index.html index.htm; + + root /var/www/html; + + location / { + try_files $uri $uri/ /index.php$is_args$args; + + auth_basic "restricted area"; + auth_basic_user_file /etc/nginx/conf.d/http_password.dat; + + } + + location ~ \.php$ { + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass wordpress:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } + + 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/wp_install.txt b/wp_install.txt new file mode 100644 index 0000000..ad623ea --- /dev/null +++ b/wp_install.txt @@ -0,0 +1,3 @@ +curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar +chmod +x wp-cli.phar +mv wp-cli.phar /usr/local/bin/wp