https://github.com/gh640/gh640-cron-docker
A WordPress plugin which prevents WordPress automatic update from failing with port fowarding on Docker containers.
https://github.com/gh640/gh640-cron-docker
wordpress wordpress-development wordpress-plugin
Last synced: about 2 months ago
JSON representation
A WordPress plugin which prevents WordPress automatic update from failing with port fowarding on Docker containers.
- Host: GitHub
- URL: https://github.com/gh640/gh640-cron-docker
- Owner: gh640
- License: gpl-2.0
- Created: 2020-02-01T02:10:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-29T01:30:46.000Z (over 6 years ago)
- Last Synced: 2025-01-14T14:17:25.624Z (over 1 year ago)
- Topics: wordpress, wordpress-development, wordpress-plugin
- Language: PHP
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: docs/README.md
- License: LICENSE
Awesome Lists containing this project
README
# `gh640-cron-docker`
This is a tiny WordPress plugin which prevents WordPress automatic update from
failing when run in a Docker container.
WordPress doesn't recognize the own domain correctly if port fowarding is enabled for different ports when run in a Docker container:
```yaml
version: "3"
services:
web:
image: wordpress:latest
ports:
- "8000:80"
```
The automatic update triggered in the WP Cron fails if the own domain is not correct. A sample error message is:
> cURL error 7: Failed to connect to localhost port 8000 Connection refused
## Usage
Install and activate the plugin and set up the following 2 environment variables:
- `DOCKER_HTTP_PORT_GUEST`
- `DOCKER_HTTP_PORT_HOST`
Here is a simple example of `docker-compose.yml`:
```yaml
version: "3"
services:
web:
image: wordpress:latest
environment:
DOCKER_HTTP_PORT_GUEST: 80
DOCKER_HTTP_PORT_HOST: 8000
ports:
- "8000:80"
```
## Tested on
- WordPress 5.3.2
- PHP 7.3