This will build a Docker Image for Wordpress. A web based content management system. It will:
wp-config.php
for youClone this repository and build the image with docker build <arguments> (imagename) .
Builds of the image are available on Docker Hub
docker pull docker.io/tiredofit/wordpress:(imagetag)
Builds of the image are also available on the Github Container Registry
docker pull ghcr.io/tiredofit/docker-wordpress:(imagetag)
The following image tags are available along with their tagged release based on what's written in the Changelog:
PHP version | OS | Tag |
---|---|---|
8.3.x | Alpine | :php-8.3 |
8.2.x | Alpine | :php-8.2 |
8.1.x | Alpine | :php-8.1 |
8.0.x | Alpine | :php-8.0 |
7.4.x | Alpine | :php-7.4 |
7.3.x | Alpine | :php-7.3 |
7.2.x | Alpine | :php-7.2 |
7.1.x | Alpine | :php-7.1 |
7.0.x | Alpine | :php-7.0 |
5.6.x | Alpine | :php5.6 |
Images are built primarily for amd64
architecture, and may also include builds for arm/v7
, arm64
and others. These variants are all unsupported. Consider sponsoring my work so that I can work with various hardware. To see if this image supports multiple architecures, type docker manifest (image):(tag)
The quickest way to get started is using docker-compose. See the examples folder for a working compose.yml that can be modified for development or production use.
Set various environment variables to understand the capabilities of this image.
Map persistent storage for access to configuration and data files for backup.
The following directories are used for configuration and can be mapped for persistent storage.
Directory | Description |
---|---|
/www/wordpress |
Root Wordpress Directory |
/www/logs |
Nginx and php-fpm logfiles |
This image relies on an Alpine Linux base image that relies on an init system for added capabilities. Outgoing SMTP capabilities are handlded via msmtp
. Individual container performance monitoring is performed by zabbix-agent. Additional tools include: bash
,curl
,less
,logrotate
,nano
.
Be sure to view the following repositories to understand all the customizable options:
Image | Description |
---|---|
OS Base | Customized Image based on Alpine Linux |
Nginx | Nginx webserver |
PHP-FPM | PHP Interpreter |
Parameter | Description | Default | _FILE |
---|---|---|---|
ADMIN_EMAIL |
Email address for the Administrator - Needed for initial startup | x | |
ADMIN_USER |
Username for the Administrator - Needed for initial startup | admin |
x |
ADMIN_PASS |
Password for the Administrator - Needed for initial startup | x | |
ENABLE_HTTPS_REVERSE_PROXY |
Tweak nginx to run behind a reverse proxy for URLs TRUE / FALSE |
TRUE |
|
DB_CHARSET |
MariaDB character set for tables | utf8mb4 |
|
DB_HOST |
MariaDB external container hostname (e.g. wordpress-db) | x | |
DB_NAME |
MariaDB database name i.e. (e.g. wordpress) | x | |
DB_USER |
MariaDB username for database (e.g. wordpress) | x | |
DB_PASS |
MariaDB password for database (e.g. userpassword) | x | |
DB_PORT |
MariaDB port for database | 3306 |
x |
DB_PREFIX |
MariaDB Prefix for DB_NAME |
wp_ |
x |
DEBUG_MODE |
Enable Debug Mode (verbosity) for the container installation/startup and in application - TRUE / FALSE |
FALSE |
|
ROTATE_KEYS |
Rotate Salts and Keys on subsequent reboots TRUE / FALSE |
FALSE |
|
SITE_LOCALE |
What Locale to set site | en_US |
|
SITE_PORT |
What Port does wordpress deliver assets to | 80 |
|
SITE_TITLE |
The title of the Website | Docker Wordpress |
|
SITE_URL |
The Full site URL of the installation e.g. wordpress.example.com - Needed for initial startup |
||
SITE_URL_UPDATE_MODE |
After first install, perform modifications to wp-config.php and DB if different Site URL FILE DB ALL NONE |
ALL |
|
UPDATE_MODE |
ALL to enable all major, minor updates, MINOR to only allow minor updates NONE to disable all updates |
minor |
The following ports are exposed.
Port | Description |
---|---|
80 |
HTTP |
For debugging and maintenance purposes you may want access the containers shell.
docker exec -it (whatever your container name is) bash
Wordpress assets are delivered by means of the initial Site URL, and if you wish to develop locally or on a different port you will experience strange results. If you are performing local development then you would want to setup your environment variables as such:
ENABLE_HTTPS_REVERSE_PROXY=FALSE
SITE_URL=localhost
SITE_PORT=8000
(or whatever port you are exposing)When you are ready to deploy to a production URL - you would change it as such:
ENABLE_HTTPS_REVERSE_PROXY=TRUE
SITE_URL=www.domain.com
The system will rotate the URLs in the wordpress configuration files and database automatically upon restart of the container.
If you wish to use the included wp-cli tool to perform maintenance use it as such:
cd /www/wordpress
wp-cli <argument>
These images were built to serve a specific need in a production environment and gradually have had more functionality added based on requests from the community.
MIT. See LICENSE for more details.
For debugging and maintenance purposes you may want access the containers shell.
docker exec -it (whatever your container name is e.g. wordpress) bash