From 4a67c850bda0f682508db5e24a0169bdf8f1f317 Mon Sep 17 00:00:00 2001 From: Adam Turner Date: Tue, 28 Jul 2020 12:05:28 -0700 Subject: [PATCH 1/4] :truck: Move php config into `config` and update rules --- config/php/php.ini | 9 +++++++++ docker-compose.yml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 config/php/php.ini diff --git a/config/php/php.ini b/config/php/php.ini new file mode 100644 index 0000000..95a08e7 --- /dev/null +++ b/config/php/php.ini @@ -0,0 +1,9 @@ +error_reporting = E_ALL +display_startup_errors = On +display_errors = On + +upload_max_filesize = 100M +post_max_size = 100M + +max_execution_time = 3600 +request_terminate_timeout = 3600 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 9d22354..6d05ad1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,7 +28,7 @@ services: - "./wordpress:/var/www/html/" - "./plugins:/var/www/html/wp-content/plugins" - "./themes:/var/www/html/wp-content/themes" - - "./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini" + - "./config/php/php.ini:/usr/local/etc/php/conf.d/custom.ini" volumes: db_data: {} From 57767bc9932ee4507f5fda72f3e889f2fdbc20d0 Mon Sep 17 00:00:00 2001 From: Adam Turner Date: Wed, 29 Jul 2020 09:33:08 -0700 Subject: [PATCH 2/4] :truck: Move env config into `config` --- .env-example => config/.env-example | 8 ++++---- start.sh | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) rename .env-example => config/.env-example (67%) diff --git a/.env-example b/config/.env-example similarity index 67% rename from .env-example rename to config/.env-example index 735da4e..402c419 100644 --- a/.env-example +++ b/config/.env-example @@ -6,13 +6,13 @@ # 2. Replace the sample credentials with your own. # The name of the database for WordPress -MYSQL_DATABASE=database_name_here +MYSQL_DATABASE= # MySQL database username -MYSQL_USER=username_here +MYSQL_USER= # MySQL database password -MYSQL_PASSWORD=mysql_password_here +MYSQL_PASSWORD= # MySQL root password -MYSQL_ROOT_PASSWORD=mysql_root_password_here \ No newline at end of file +MYSQL_ROOT_PASSWORD= \ No newline at end of file diff --git a/start.sh b/start.sh index ffbe344..be1754b 100755 --- a/start.sh +++ b/start.sh @@ -9,6 +9,10 @@ if [ ! -f './config/wordpress/Dockerfile' ]; then sed -i '' -e "s/\$GID/${GROUP_ID}/g" './config/wordpress/Dockerfile' fi +if [ ! -f './.env' ]; then + cp './config/.env-example' './.env' +fi + docker-compose up --detach docker exec -ti wordpress /bin/bash -c 'chown -R www-data: /var/www/html' \ No newline at end of file From a83f198c35a3de8209881bd7d309c529a1951c40 Mon Sep 17 00:00:00 2001 From: Adam Turner Date: Wed, 29 Jul 2020 09:33:39 -0700 Subject: [PATCH 3/4] Remove old uploads.ini file in place of php.ini config --- uploads.ini | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 uploads.ini diff --git a/uploads.ini b/uploads.ini deleted file mode 100644 index d7f0e32..0000000 --- a/uploads.ini +++ /dev/null @@ -1,5 +0,0 @@ -file_uploads = On -memory_limit = 64M -upload_max_filesize = 20M -post_max_size = 20M -max_execution_time = 600 \ No newline at end of file From b8d3cd710e10144e29d5d686090c1b081bedee69 Mon Sep 17 00:00:00 2001 From: Adam Turner Date: Wed, 29 Jul 2020 09:40:12 -0700 Subject: [PATCH 4/4] Rename WP dockerfile dir to `containers` --- .gitignore | 2 +- config/{wordpress => containers}/Dockerfile.template | 0 docker-compose.yml | 2 +- start.sh | 8 ++++---- 4 files changed, 6 insertions(+), 6 deletions(-) rename config/{wordpress => containers}/Dockerfile.template (100%) diff --git a/.gitignore b/.gitignore index f0733cc..e5ba301 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ .env # Ignore the built config files. -config/wordpress/Dockerfile +config/containers/Dockerfile # Don't share individual sites files. /wordpress/* diff --git a/config/wordpress/Dockerfile.template b/config/containers/Dockerfile.template similarity index 100% rename from config/wordpress/Dockerfile.template rename to config/containers/Dockerfile.template diff --git a/docker-compose.yml b/docker-compose.yml index ede601f..8eb53ea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,7 @@ services: container_name: wordpress depends_on: - db - build: "./config/wordpress" + build: "./config/containers" ports: - "8000:80" restart: always diff --git a/start.sh b/start.sh index be1754b..4d3ab33 100755 --- a/start.sh +++ b/start.sh @@ -3,10 +3,10 @@ USER_ID=`id -u` GROUP_ID=`id -g` -if [ ! -f './config/wordpress/Dockerfile' ]; then - cp './config/wordpress/Dockerfile.template' './config/wordpress/Dockerfile' - sed -i '' -e "s/\$UID/${USER_ID}/g" './config/wordpress/Dockerfile' - sed -i '' -e "s/\$GID/${GROUP_ID}/g" './config/wordpress/Dockerfile' +if [ ! -f './config/containers/Dockerfile' ]; then + cp './config/containers/Dockerfile.template' './config/containers/Dockerfile' + sed -i '' -e "s/\$UID/${USER_ID}/g" './config/containers/Dockerfile' + sed -i '' -e "s/\$GID/${GROUP_ID}/g" './config/containers/Dockerfile' fi if [ ! -f './.env' ]; then