diff --git a/config/Dockerfile b/config/Dockerfile deleted file mode 100644 index f66ed0e..0000000 --- a/config/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM wordpress:5-php7.3-apache - -# # Possible -# # bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash -# # iconv imap interbase intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib -# # pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline -# # recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem -# # sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip - -RUN docker-php-ext-install pdo_mysql \ - && a2enmod ext_filter headers \ No newline at end of file diff --git a/config/custom.ini b/config/custom.ini deleted file mode 100644 index 01fb05c..0000000 --- a/config/custom.ini +++ /dev/null @@ -1,5 +0,0 @@ -file_uploads = On -memory_limit = 512M -upload_max_filesize = 512M -post_max_size = 512M -max_execution_time = 300 \ No newline at end of file diff --git a/config/nginx/nginx.conf b/config/nginx/nginx.conf new file mode 100644 index 0000000..db3e812 --- /dev/null +++ b/config/nginx/nginx.conf @@ -0,0 +1,39 @@ +server { + listen 80; + access_log off; + + server_name _; + server_tokens off; + + root /var/www/html; + index index.php; + + client_max_body_size 512M; + + location = /favicon.ico { + log_not_found off; + access_log off; + } + + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + } + + location / { + try_files $uri $uri/ /index.php?$args; + } + + location ~ \.php$ { + #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini + include fastcgi.conf; + fastcgi_intercept_errors on; + fastcgi_pass wordpress:9000; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { + expires max; + log_not_found off; + } +} \ No newline at end of file diff --git a/config/wp/Dockerfile b/config/wp/Dockerfile new file mode 100644 index 0000000..928d54f --- /dev/null +++ b/config/wp/Dockerfile @@ -0,0 +1,12 @@ +# FROM wordpress:5-php7.3-apache +FROM wordpress:fpm-alpine + +# Possible extensions to install if needed 👇 + +# bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash +# iconv imap interbase intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib +# pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline +# recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem +# sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip + +RUN docker-php-ext-install pdo_mysql \ No newline at end of file diff --git a/config/wp/custom.conf b/config/wp/custom.conf new file mode 100644 index 0000000..85c851d --- /dev/null +++ b/config/wp/custom.conf @@ -0,0 +1,6 @@ +[www] + +php_admin_value[memory_limit] = 512M +php_admin_value[upload_max_filesize] = 512M +php_admin_value[post_max_size] = 512M +php_admin_value[max_execution_time] = 300 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f75a2aa..14e0ba3 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,23 +1,33 @@ -version: '3.7' +version: "3.7" x-default: &default restart: unless-stopped env_file: ./config/.env services: - - wp: - <<: *default - build: ./config + nginx: + image: nginx:alpine + restart: unless-stopped + depends_on: + - wordpress + volumes: + - ./config/nginx:/etc/nginx/conf.d + - ./data/wp:/var/www/html ports: - 80:80 + + wordpress: + <<: *default + build: ./config/wp volumes: - - ./config/custom.ini:/usr/local/etc/php/conf.d/uploads.ini:ro - - ./data/wp:/var/www/html - - ./theme:/var/www/html/wp-content/themes/theme:ro + - ./config/wp/custom.conf:/usr/local/etc/php-fpm.d/custom.conf + - ./data/wp:/var/www/html + - ./theme:/var/www/html/wp-content/themes/theme:ro + depends_on: + - db db: <<: *default - image: mariadb:10.3 + image: mariadb:10 volumes: - - ./data/db:/var/lib/mysql \ No newline at end of file + - ./data/db:/var/lib/mysql