Developing WordPress Total Child Theme in Docker

First significant challenge is that archive pages aren’t working.

Am I missing a setting somewhere?

Figured I would install the Base-Lite demo, but server kept timing out.

Need to increase limits in the container:

Add this uploads.ini file in top level of WP in host computer.

file_uploads = On
memory_limit = 64M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 600

Then add following lines to the wordpress container in docker-compose.yml:

volumes:
    - uploads.ini:/usr/local/etc/php/conf.d/uploads.ini

Then docker-compose stop, docker-compose up -d.

Then confirm it’s there with

docker-compose run --rm my-wp ls /usr/local/etc/php/conf.d/

Whoops. Overrode my original volume mapping to /var/www/html. Let’s try again just adding the volume mapping for uploads.ini. Hmmm:

Host mapping "~/Docker/WP/americare" has no effect. Remove the existing containers (with `docker-compose rm my-wp`) to use the host volume mapping.

And:

$ docker-compose stop
Stopping americare_my-wp_1 ... done
Stopping americare_my-wpdb_1 ... done
mikekilmer@jamaaladeen-2:~/Docker/WP/project/wp-content/themes/total-child-project$ docker-compose rm my-wp
Going to remove americare_my-wp_1
Are you sure? [yN] y
Removing americare_my-wp_1 ... done
mikekilmer@jamaaladeen-2:~/Docker/WP/project/wp-content/themes/total-child-project$ docker-compose up -d
Starting americare_my-wpdb_1
Creating americare_my-wp_1
Recreating americare_my-wpcli_1
mikekilmer@jamaaladeen-2:~/Docker/WP/project/wp-content/themes/total-child-project$ docker-compose run --rm my-wp ls /usr/local/etc/php/conf.d/
docker-php-ext-gd.ini      docker-php-ext-opcache.ini  uploads.ini
docker-php-ext-mysqli.ini  opcache-recommended.ini
mikekilmer@jamaaladeen-2:~/Docker/WP/project/wp-content/themes/total-child-project$ docker-compose run --rm my-wp ls /var/www/html
README.md       wp-activate.php   wp-content         wp-mail.php
docker-compose.yml  wp-admin          wp-cron.php        wp-settings.php
index.php       wp-blog-header.php    wp-includes        wp-signup.php
license.txt     wp-comments-post.php  wp-links-opml.php  wp-trackback.php
readme.html     wp-config-sample.php  wp-load.php        xmlrpc.php
uploads.ini     wp-config.php     wp-login.php

Looking good. Let’s try and run that importer again.

The Samus demo is smaller and also has the Staff CPT added. Their CPTs are set to archive none and the “archive pages” are created with Visual Editor, which includes the file /Total/assets/js/wpex.min.js which is 440K almost half a megabyte. We might not need all that.

So maybe I’ll make a little plugin for displaying the caregivers with the custom search. Some resources:

https://www.codersclan.net/ticket/73
https://wordpress.org/plugins/wanna-isotope/
http://redvinestudio.com/how-to-build-isotope-portfolio-in-your-wordpress-theme/

When we added a bunch of node_modules, Docker croaked trying to sync the gigantic node_modules directory:

ERROR: for my-wp  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=70)

Need to skip that directory.

Couldn’t even kill the container with docker-compose kill my-wp so may have to remove altogether.

This command finally got it to stop running: docker rm -fv container_id_as_returned_by_docker_ps_command. Then docker froze. Restarting the computer seems to have solved the issue.

To get in to Docker container on the command line:

docker exec -it <mycontainer> bash

I want to include a log file in the directory, but not track changes to it, although have it in the repo.

git update-index --assume-unchanged FILE_NAME

Good resource for adding more isotope filter options.

Here are some cool insights about Benchmarking.