Browse Source

PHPMyAdmin hinzugefügt, ssl enabled zwischen nginx und wordpress, nginx timeout erhöht

Pascal Lang 2 years ago
parent
commit
10d73afb88
5 changed files with 53 additions and 4 deletions
  1. 13 1
      docker-compose.yml
  2. 1 1
      nginx/default.site
  3. 4 0
      nginx/proxy_params
  4. 12 2
      wordpress/Dockerfile
  5. 23 0
      wordpress/default_443.conf

+ 13 - 1
docker-compose.yml

@@ -1,7 +1,9 @@
 version: "3.8"
 services:
   wordpress:
-    build: ./wordpress
+    build: 
+      context: .
+      dockerfile: wordpress/Dockerfile
     environment:
       WORDPRESS_DB_HOST: "mysql"
       WORDPRESS_DB_USER: "wp_dev"
@@ -18,6 +20,16 @@ services:
     volumes:
       - ./mysql/db:/var/lib/mysql
     # restart: always
+  pma:
+    image: phpmyadmin/phpmyadmin
+    links:
+      - mysql:db
+    ports:
+      - 8030:80
+    environment:
+      MYSQL_USER: wp_dev
+      MYSQL_PASSWORD: zmKHxWvm3zWK6h69ZJHk
+      MYSQL_ROOT_PASSWORD: zmKHxWvm3zWK6h69ZJHk
   nginx:
     build: ./nginx
     ports:

+ 1 - 1
nginx/default.site

@@ -7,7 +7,7 @@ server {
     client_max_body_size 1024M;
 
     location / {
-        proxy_pass  http://wordpress:80;
+        proxy_pass  https://wordpress:443;
         include     /etc/nginx/proxy_params;
     }
 }

+ 4 - 0
nginx/proxy_params

@@ -2,3 +2,7 @@ proxy_set_header Host $http_host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header X-Forwarded-Proto $scheme;
+
+proxy_read_timeout 1800;
+proxy_connect_timeout 1800;
+proxy_send_timeout 1800;

+ 12 - 2
wordpress/Dockerfile

@@ -1,5 +1,15 @@
-FROM wordpress
+FROM wordpress:php7.4-apache
 
-COPY ./uploads.ini /usr/local/etc/php/conf.d/uploads.ini
+# SSL Setup
+COPY ./nginx/selfsigned.key /etc/ssl/private/selfsigned.key
+COPY ./nginx/selfsigned.pem /etc/ssl/selfsigned.pem
+
+# Apache / PHP setup
+COPY ./wordpress/uploads.ini /usr/local/etc/php/conf.d/uploads.ini
+
+COPY ./wordpress/default_443.conf /etc/apache2/sites-available/default-ssl.conf
+
+RUN ln -s /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-enabled/
+RUN a2enmod headers ssl
 
 RUN service apache2 restart

+ 23 - 0
wordpress/default_443.conf

@@ -0,0 +1,23 @@
+<IfModule mod_ssl.c>
+	<VirtualHost *:443>
+		ServerAdmin 	wp-admin@hostbbq.com
+
+		DocumentRoot 	/var/www/html
+
+		LogFormat       "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+		LogFormat       "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
+		SetEnvIf        Remote_Addr     "212.9.180.187"      dontlog
+		SetEnvIf        Remote_Addr     "212.9.180.188"      dontlog
+		SetEnvIf        Request_URI     "health_check\.php"  dontlog
+		SetEnvIf        Request_URI     "server-status"      dontlog
+		SetEnvIf        User-Agent      check_http           dontlog
+		SetEnvIf        X-Forwarded-For "^.*\..*\..*\..*"    forwarded
+
+		ErrorLog ${APACHE_LOG_DIR}/error.log
+        CustomLog ${APACHE_LOG_DIR}/access.log combined
+
+		SSLEngine 	on
+		SSLCertificateKeyFile	/etc/ssl/private/selfsigned.key
+		SSLCertificateFile		/etc/ssl/selfsigned.pem
+	</VirtualHost>
+</IfModule>