move to fpm

This commit is contained in:
cupcakearmy 2020-05-23 17:09:29 +02:00
parent bfbf4bbffb
commit a6c5e3fa2f
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9
6 changed files with 77 additions and 26 deletions

View File

@ -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

View File

@ -1,5 +0,0 @@
file_uploads = On
memory_limit = 512M
upload_max_filesize = 512M
post_max_size = 512M
max_execution_time = 300

39
config/nginx/nginx.conf Normal file
View File

@ -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;
}
}

12
config/wp/Dockerfile Normal file
View File

@ -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

6
config/wp/custom.conf Normal file
View File

@ -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

View File

@ -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
- ./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