Working with Docker environments
Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run, including libraries, system tools, code, and runtime.
Docker WordPress Images
There are two popular Docker images for WordPress:
- The official one: https://hub.docker.com/_/wordpress (which we recommend)
- The Bitnami one: https://hub.docker.com/r/bitnami/wordpress (which we don't recommend)
While the Bitnami Docker image is unsuitable for running a Static WordPress website for various reasons (outdated packages, remapped standard ports, and a default proxy setup), it seems to be the more popular one available via one-click installations on Digital Ocean and other cloud infrastructure providers.
extra_hosts
You should first look into your compose.yml file for your Docker image.
Simply Static uses cURL as a package to crawl your pages. Because of this, you will need to add the URL of your WordPress installation as an extra host. Otherwise, the server will deny the cURL requests.
You will find a section called "wordpress" inside your config file - add the URL and the IP address:
wordpress: image: wordpress extra_hosts: # Set URL and IP as extra host inside the compose.yml file. - mysite.com:172.18.0.2 ...
Wrong Ports
The wp_remote_get() function in WordPress is a wrapper around cURL and extends it with several WordPress-specific features, such as sanitization and escaping.
This function always listens to port 80:80, which is fine for 99% of the use cases.
However, as mentioned earlier, the Bitnami Docker Image complicates matters by mapping the default port for HTTP requests to 8080:80.
This can cause Simply Static to never stop the crawling process, as we can't track the progress of the export.
The fix is similarly easy: change the port back to 80:80 and everything works as expected.
This is the default configuration shown in the Bitnami Docker documentation:
docker run -d --name wordpress \ -p 8080:8080 -p 8443:8443 \ --env ALLOW_EMPTY_PASSWORD=yes \ --env WORDPRESS_DATABASE_USER=bn_wordpress \ --env WORDPRESS_DATABASE_PASSWORD=bitnami \ --env WORDPRESS_DATABASE_NAME=bitnami_wordpress \ --network wordpress-network \ --volume /path/to/wordpress-persistence:/bitnami/wordpress \ bitnami/wordpress:latest
Instead, you set it back to the default port:
docker run -d --name wordpress \ -p 80:80 -p 8443:8443 \ --env ALLOW_EMPTY_PASSWORD=yes \ --env WORDPRESS_DATABASE_USER=bn_wordpress \ --env WORDPRESS_DATABASE_PASSWORD=bitnami \ --env WORDPRESS_DATABASE_NAME=bitnami_wordpress \ --network wordpress-network \ --volume /path/to/wordpress-persistence:/bitnami/wordpress \ bitnami/wordpress:latest