From 82571b93d640cbd5ec7d957aab501d41230c1495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Primo=C5=BE=20Poker=C5=BEnik?= Date: Sat, 6 Apr 2024 16:43:53 +0200 Subject: [PATCH] Add Wordpress --- Wordpress/.env | 3 +++ Wordpress/docker-compose.yml | 39 ++++++++++++++++++++++++++++++++++++ Wordpress/nginx.conf | 36 +++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 Wordpress/.env create mode 100644 Wordpress/docker-compose.yml create mode 100644 Wordpress/nginx.conf diff --git a/Wordpress/.env b/Wordpress/.env new file mode 100644 index 0000000..9301bee --- /dev/null +++ b/Wordpress/.env @@ -0,0 +1,3 @@ +MYSQL_ROOT_PASSWORD= +MYSQL_USER= +MYSQL_PASSWORD= \ No newline at end of file diff --git a/Wordpress/docker-compose.yml b/Wordpress/docker-compose.yml new file mode 100644 index 0000000..1805963 --- /dev/null +++ b/Wordpress/docker-compose.yml @@ -0,0 +1,39 @@ +version: "3.8" +services: + db: + image: mysql:8.0 + container_name: db + restart: unless-stopped + env_file: .env + environment: + - MYSQL_DATABASE=wordpress + volumes: + - ./db:/var/lib/mysql + command: '--default-authentication-plugin=mysql_native_password' + + wordpress: + depends_on: + - db + image: wordpress:6.5.0-php8.3-fpm-alpine + container_name: wordpress + restart: unless-stopped + env_file: .env + environment: + - WORDPRESS_DB_HOST=db:3306 + - WORDPRESS_DB_USER=$MYSQL_USER + - WORDPRESS_DB_PASSWORD=$MYSQL_PASSWORD + - WORDPRESS_DB_NAME=wordpress + volumes: + - ./data:/var/www/html + + web: + depends_on: + - wp + image: nginx:stable-alpine + container_name: web + restart: unless-stopped + ports: + - "80:80" + volumes: + - ./data:/var/www/html:ro + - ./nginx.conf:/etc/nginx/conf.d/default.conf \ No newline at end of file diff --git a/Wordpress/nginx.conf b/Wordpress/nginx.conf new file mode 100644 index 0000000..0cebe5f --- /dev/null +++ b/Wordpress/nginx.conf @@ -0,0 +1,36 @@ +server { + listen 80; + + index index.php index.html index.htm; + + root /var/www/html; + + location / { + try_files $uri $uri/ /index.php$is_args$args; + } + + 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; + } +} \ No newline at end of file