├── .dockerignore
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── config.yml
├── dependabot.yml
└── workflows
│ ├── main.yml
│ └── manual.yml
├── CHANGELOG.md
├── Dockerfile
├── LICENSE
├── README.md
├── examples
└── compose.yml
├── install
├── assets
│ ├── defaults
│ │ └── 30-wordpress
│ └── functions
│ │ └── 30-wordpress
└── etc
│ ├── cont-init.d
│ └── 30-wordpress
│ ├── nginx
│ └── sites.available
│ │ └── wordpress.conf
│ └── zabbix
│ └── zabbix_agentd.conf.d
│ ├── scripts
│ ├── wp_discover_files.py
│ └── wp_find_updates.sh
│ └── wordpress_updates.conf
└── zabbix_templates
└── webapp_wordpress.xml
/.dockerignore:
--------------------------------------------------------------------------------
1 | examples/
2 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [tiredofit]
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: If something isn't working right..
4 | title: ''
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | ### Summary
11 |
12 |
13 |
14 |
15 | ### Steps to reproduce
16 |
17 |
18 |
19 |
20 | ### What is the expected *correct* behavior?
21 |
22 |
23 |
24 |
25 | ### Relevant logs and/or screenshots
26 |
27 |
28 |
29 | ### Environment
30 |
31 |
32 | - Image version / tag:
33 | - Host OS:
34 |
35 |
36 | Any logs | docker-compose.yml
37 |
38 |
39 |
40 |
41 | ### Possible fixes
42 |
43 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea or feature
4 | title: ''
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | ---
11 | name: Feature Request
12 | about: Suggest an idea for this project
13 |
14 | ---
15 |
16 | **Description of the feature**
17 |
18 |
19 | **Benftits of feature**
20 |
21 |
22 | **Additional context**
23 |
24 |
--------------------------------------------------------------------------------
/.github/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | # Maintain dependencies for GitHub Actions
4 | - package-ecosystem: "github-actions"
5 | directory: "/"
6 | schedule:
7 | interval: "daily"
8 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | ### Application Level Image CI - Wordpress
2 | ### Dave Conroy
3 |
4 | name: 'Multi PHP Version Build'
5 | on:
6 | schedule:
7 | - cron: 1 10 * * 6
8 | push:
9 | paths:
10 | - '**'
11 | - '!README.md'
12 | jobs:
13 | php56:
14 | uses: tiredofit/github_actions/.github/workflows/php56_alpine_amd64.yml@main
15 | secrets: inherit
16 | php70:
17 | uses: tiredofit/github_actions/.github/workflows/php70_alpine_amd64.yml@main
18 | secrets: inherit
19 | php71:
20 | uses: tiredofit/github_actions/.github/workflows/php71_alpine_amd64.yml@main
21 | secrets: inherit
22 | php72:
23 | uses: tiredofit/github_actions/.github/workflows/php72_alpine_amd64.yml@main
24 | secrets: inherit
25 | php73:
26 | uses: tiredofit/github_actions/.github/workflows/php73_alpine_amd64_armv7_arm64.yml@main
27 | secrets: inherit
28 | php74:
29 | uses: tiredofit/github_actions/.github/workflows/php74_alpine_amd64_armv7_arm64.yml@main
30 | secrets: inherit
31 | php80:
32 | uses: tiredofit/github_actions/.github/workflows/php80_alpine_amd64_armv7_arm64.yml@main
33 | secrets: inherit
34 | php81:
35 | uses: tiredofit/github_actions/.github/workflows/php81_alpine_amd64_armv7_arm64.yml@main
36 | secrets: inherit
37 | php82:
38 | uses: tiredofit/github_actions/.github/workflows/php82_alpine_amd64_armv7_arm64.yml@main
39 | secrets: inherit
40 | php83:
41 | uses: tiredofit/github_actions/.github/workflows/php83_alpine_amd64_armv7_arm64.yml@main
42 | secrets: inherit
43 |
--------------------------------------------------------------------------------
/.github/workflows/manual.yml:
--------------------------------------------------------------------------------
1 | # Manual Workflow (Wordpress)
2 |
3 | name: manual_build
4 |
5 | on:
6 | workflow_dispatch:
7 | inputs:
8 | Manual Build:
9 | description: 'Manual Build'
10 | required: false
11 | jobs:
12 | php56:
13 | uses: tiredofit/github_actions/.github/workflows/php56_alpine_amd64.yml@main
14 | secrets: inherit
15 | php70:
16 | uses: tiredofit/github_actions/.github/workflows/php70_alpine_amd64.yml@main
17 | secrets: inherit
18 | php71:
19 | uses: tiredofit/github_actions/.github/workflows/php71_alpine_amd64.yml@main
20 | secrets: inherit
21 | php72:
22 | uses: tiredofit/github_actions/.github/workflows/php72_alpine_amd64.yml@main
23 | secrets: inherit
24 | php73:
25 | uses: tiredofit/github_actions/.github/workflows/php73_alpine_amd64_armv7_arm64.yml@main
26 | secrets: inherit
27 | php74:
28 | uses: tiredofit/github_actions/.github/workflows/php74_alpine_amd64_armv7_arm64.yml@main
29 | secrets: inherit
30 | php80:
31 | uses: tiredofit/github_actions/.github/workflows/php80_alpine_amd64_armv7_arm64.yml@main
32 | secrets: inherit
33 | php81:
34 | uses: tiredofit/github_actions/.github/workflows/php81_alpine_amd64_armv7_arm64.yml@main
35 | secrets: inherit
36 | php82:
37 | uses: tiredofit/github_actions/.github/workflows/php82_alpine_amd64_armv7_arm64.yml@main
38 | secrets: inherit
39 | php83:
40 | uses: tiredofit/github_actions/.github/workflows/php83_alpine_amd64_armv7_arm64.yml@main
41 | secrets: inherit
42 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 5.8.2 2024-04-16
2 |
3 | ### Changed
4 | - Remove PHP_ENABLE_ZLIB to quiet down some warnings
5 | - Rebuild to fix some upstream issues with imagemagick
6 |
7 |
8 | ## 5.8.1 2024-03-25
9 |
10 | ### Added
11 | - Decalre a series of PHP extensions enabled (exif,gd,imagick,redis,shmop,simplexml,xml,xmlreader,zip,zlib)
12 |
13 |
14 | ## 5.8.0 2024-01-25
15 |
16 | ### Added
17 | - Change sed statements to use wp-cli
18 |
19 |
20 | ## 5.7.5 2023-08-15
21 |
22 | ### Changed
23 | - Fix issue with different default values of ENABLE_HTTPS_REVERSE_PROXY environment variable
24 |
25 |
26 | ## 5.7.4 2023-07-20
27 |
28 | ### Changed
29 | - Quiet down some output on screen when performing update setup except if LOG_LEVEL=DEBUG
30 |
31 |
32 | ## 5.7.3 2023-06-29
33 |
34 | ### Changed
35 | - Resolve multi lined sed expression joining
36 |
37 |
38 | ## 5.7.2 2023-06-28
39 |
40 | ### Changed
41 | - Revert nginx configuration to <5.5.0 versioning letting upstream nginx image handle caching and logging optimizations
42 |
43 |
44 | ## 5.7.1 2023-06-13
45 |
46 | ### Added
47 | - Add xmlstarlet package
48 |
49 |
50 | ## 5.7.0 2023-05-29
51 |
52 | ### Added
53 | - Add UPDATE_MODE environment variable (default minor) to control Wordpress manor, minor automatic updating
54 |
55 |
56 | ## 5.6.0 2023-04-26
57 |
58 | ### Added
59 | - Introduce support for '_FILE' environment variables
60 |
61 |
62 | ## 5.5.0 2023-04-12
63 |
64 | ### Added
65 | - Rotate DB_HOST, DB_PORT, DB_USER, DB_PASS, DB_NAME in wp-config.php on each startup
66 | - Introduce ROTATE_KEYS variable to rotate salts and keys on each startup
67 | - Correctly allow custom DB_PORTs to function
68 | - Quiet down nginx log for some file types
69 |
70 |
71 | ## 5.4.6 2023-04-05
72 |
73 | ### Changed
74 | - Alter Dockerfile to solve some build issues
75 |
76 |
77 | ## 5.4.5 2023-02-06
78 |
79 | ### Changed
80 | - Add safety net when executing wp-cli search and replace to scope specifically to NGINX_WEBROOT
81 |
82 |
83 | ## 5.4.4 2023-02-06
84 |
85 | ### Changed
86 | - Fix for ENABLE_HTTPS_REVERSE_PROXY variable
87 |
88 |
89 | ## 5.4.3 2023-02-06
90 |
91 | ### Changed
92 | - Fix SITE_URL_UPDATE_MODE parameters
93 |
94 |
95 | ## 5.4.2 2022-12-14
96 |
97 | ### Added
98 | - Introduce PHP 8.2 support
99 |
100 |
101 | ## 5.4.1 2022-12-01
102 |
103 | ### Changed
104 | - Rework Dockerfile
105 |
106 |
107 | ## 5.4.0 2022-11-29
108 |
109 | ### Changed
110 | - Move routines to seperate functions
111 | - Optimize downloading wp-cli
112 | - Rework Dockerfile for quicker and better CI capabilities
113 |
114 |
115 | ## 5.3.8 2022-10-05
116 |
117 | ### Changed
118 | - Add some quotes around variables
119 | - Fix tab spacing
120 | - Update legacy nginx configuration
121 |
122 |
123 | ## 5.3.7 2022-06-23
124 |
125 | ### Added
126 | - Support tiredofit/nginx:6.0.0 and tiredofit/nginx-php-fpm:7.0.0 changes
127 |
128 |
129 | ## 5.3.6 2022-05-24
130 |
131 | ### Added
132 | - Introduce PHP 8.1 builds
133 |
134 |
135 | ## 5.3.5 2022-02-10
136 |
137 | ### Changed
138 | - Update to support upstream image changes
139 |
140 |
141 | ## 5.3.4 2022-01-20
142 |
143 | ### Changed
144 | - Fix for SITE_URL changing not functioning correctly
145 |
146 |
147 | ## 5.3.3 2021-12-07
148 |
149 | ### Changed
150 | - Rework Zabbix Template auto register
151 |
152 |
153 | ## 5.3.2 2021-10-22
154 |
155 | ### Changed
156 | - Fix for 5.3.1
157 |
158 |
159 | ## 5.3.1 2021-10-19
160 |
161 | ### Changed
162 | - Change to wp-cli alias to restore previous directory location after execution
163 | - Minor shellcheck cleanup
164 |
165 |
166 | ## 5.3.0 2020-06-09
167 |
168 | ### Added
169 | - Update to support tiredofit/alpine 5.0.0 base image
170 |
171 |
172 | ## 5.2.2 2020-04-21
173 |
174 | ### Added
175 | - Update to support changes in tiredofit/alpine base image
176 |
177 |
178 | ## 5.2.1 2020-01-20
179 |
180 | ### Changed
181 | - Fix in 30-wordpress container initialization routines
182 |
183 |
184 | ## 5.2.0 2020-01-03
185 |
186 | ### Added
187 | - Add SITE_URL_UPDATE_MODE environment variable
188 |
189 |
190 | ## 5.1.1 2019-12-31
191 |
192 | ### Changed
193 | - Updated warnings to notices
194 |
195 | ## 5.1.0 2019-12-29
196 |
197 | ### Changed
198 | - Change to support new tiredofit/alpine base image and new features in tireodofit/nginx
199 |
200 | ## 5.0.5 2019-12-18
201 |
202 | ### Changed
203 | - Change to support dynamic webserver user/group
204 |
205 |
206 | ## 5.0.4 2019-12-11
207 |
208 | ### Added
209 | - Add alias for running wp-cli as webserver user (type `wp-cli `)
210 |
211 |
212 | ## 5.0.3 2019-12-05
213 |
214 | ### Changed
215 | - Fix extra bracket in nginx.conf/default.conf
216 |
217 |
218 | ## 5.0.2 2019-12-05
219 |
220 | ### Added
221 | - Add python2 package to satisfy Zabbix monitoring dependency
222 |
223 |
224 | ## 5.0.1 2019-12-04
225 |
226 | ### Added
227 | - Updated image to support new tiredofit/nginx and tiredofit/nginx-php-fpm base images
228 | - Customizable Webroot for Installing
229 |
230 |
231 | ## 5.0.0 2019-11-19
232 |
233 | ### Added
234 | - Add automatic install capabilities - Set environment variables properly and have working install with no input
235 | - Add automatic altering of hostname/website URL delivery
236 | - Added new variables: ADMIN_EMAIL,ADMIN_PASS,ADMIN_USER,DB_CHARSET,DB_PREFIX,DB_PORT,SITE_LOCALE,SITE_PORT,SITE_TITLE in order to perform an installation.
237 |
238 |
239 | ## 4.4.2 2019-11-18
240 |
241 | ### Reverted
242 | - Removed Python Dependencies
243 | - Removed PDFtk Dependencies
244 |
245 |
246 | ## 4.4.1 2019-11-18
247 |
248 | ### Added
249 | - Enable switching reverse proxy on and off with Nginx `ENABLE_HTTPS_REVERSE_PROXY`
250 | - Alpine 3.10 Base
251 | - Nginx 1.16
252 | - PHP 7.3
253 |
254 | ### Changed
255 | - Major cleanup to code and modernize
256 | - Moved init script to follow proper s6-overlay installations (/etc/cont-init.d)
257 | - Cleaned up docker-compose.yml
258 | - Added some verbosity to the README
259 |
260 |
261 | ## 4.4 2018-02-01
262 |
263 | * Rebase
264 |
265 | ## 4.3 2018-01-29
266 |
267 | * Add Zabbix Checks for Wordpress
268 |
269 | ## 4.2 2017-07-06
270 |
271 | * Added PHP_TIMEOUT
272 |
273 | ## 4.1 2017-06-23
274 |
275 | * Rebase to allow msmtp and sanity checks on init
276 |
277 | ## 4.0 2017-06-23
278 |
279 | * Rebase from nginx-php-fpm
280 | * Cleaned up drastically complexity
281 |
282 |
283 | ## 3.6 2017-06-13
284 |
285 | * Added Git to Support VersionPress
286 |
287 | ## 3.5 2017-06-07
288 |
289 | * Rebase to Alpine 3.6
290 |
291 | ## 3.4 2017-04-07
292 |
293 | * Rebase Source Tree
294 |
295 | ## 3.3 2017-03-29
296 |
297 | * Added pdftk
298 |
299 | ## 3.0.2 2017-02-09
300 |
301 | * Bugfixes with Zabbix
302 | * Switched Base to local alpine:edge
303 | * Removed Sed optimizations to support persistent configuration of nginx.conf
304 |
305 | ## 3.0.1 2017-02-07
306 |
307 | * Added PHP OPCache Checks for Zabbix and Fixed some Variables
308 |
309 | ## 3.0 2017-02-07
310 |
311 | * Added Zabbix Agent
312 | * Zabbix Agent configured to check php-fpm and nginx
313 |
314 |
315 | ## 2.1 2017-01-28
316 |
317 | * Added Nginx Rewrite Rules to support SimpleSAMLPHP
318 | * Added php7-ldap, openssl
319 | * Removed Built in Redis Configuration - use external source from now on.
320 |
321 |
322 | ## 2.0 2017-01-16
323 |
324 | * Major Cleanup - Removing Environment and Security Variables which required Root
325 | * Automatically download Wordpress if not found in Persistent Storage
326 | * Cleaned up Code and Documented Stages and Processes for Learning
327 |
328 | ## 1.0 2017-01-02
329 |
330 | * Initial Release
331 | * Alpine:edge
332 | * PHP7
333 | * wp-cli
334 | * Must copy Wordpress Installation files to folder upon bootup
335 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | ARG PHP_VERSION=8.2
2 | ARG DISTRO="alpine"
3 |
4 | FROM docker.io/tiredofit/nginx-php-fpm:${PHP_VERSION}-${DISTRO}
5 | LABEL maintainer="Dave Conroy (github.com/tiredofit)"
6 |
7 | ENV PHP_ENABLE_CREATE_SAMPLE_PHP=FALSE \
8 | PHP_ENABLE_EXIF=TRUE \
9 | PHP_ENABLE_GD=TRUE \
10 | PHP_ENABLE_IGBINARY=TRUE \
11 | PHP_ENABLE_IMAGICK=TRUE \
12 | PHP_ENABLE_MYSQLI=TRUE \
13 | PHP_ENABLE_REDIS=TRUE \
14 | PHP_ENABLE_SHMOP=TRUE \
15 | PHP_ENABLE_SIMPLEXML=TRUE \
16 | PHP_ENABLE_XML=TRUE \
17 | PHP_ENABLE_XMLREADER=TRUE \
18 | PHP_ENABLE_ZIP=TRUE \
19 | NGINX_WEBROOT="/www/wordpress" \
20 | NGINX_SITE_ENABLED="wordpress" \
21 | IMAGE_NAME="tiredofit/wordpress" \
22 | IMAGE_REPO_URL="https://github.com/tiredofit/docker-wordpress/"
23 |
24 | RUN source /assets/functions/00-container && \
25 | set -x && \
26 | package update && \
27 | package upgrade && \
28 | package install xmlstarlet && \
29 | curl -o /usr/bin/wp-cli https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
30 | chmod +x /usr/bin/wp-cli && \
31 | package cleanup
32 |
33 | COPY install/ /
34 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2022 Dave Conroy
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # github.com/tiredofit/docker-wordpress
2 |
3 | [](https://github.com/tiredofit/docker-wordpress/releases/latest)
4 | [](https://github.com/tiredofit/docker-wordpress/actions)
5 | [](https://hub.docker.com/r/tiredofit/wordpress/)
6 | [](https://hub.docker.com/r/tiredofit/wordpress/)
7 | [](https://github.com/sponsors/tiredofit)
8 | [](https://www.paypal.me/tiredofit)
9 | ## About
10 |
11 | This will build a Docker Image for [Wordpress](https://www.wordpress.org/). A web based content management system. It will:
12 |
13 | * Automatically Download latest version of Wordpress
14 | * Configure `wp-config.php` for you
15 | * Install Database
16 | * Configure the website with basic information
17 | * Automatically rotate URLs on subsequent boots if they have changed
18 | * Includes [WP-CLI](http://wp-cli.org/)
19 |
20 | ## Maintainer
21 |
22 | - [Dave Conroy](https://github.com/tiredofit/)
23 |
24 | ## Table of Contents
25 |
26 | - [About](#about)
27 | - [Maintainer](#maintainer)
28 | - [Table of Contents](#table-of-contents)
29 | - [Prerequisites and Assumptions](#prerequisites-and-assumptions)
30 | - [Installation](#installation)
31 | - [Build from Source](#build-from-source)
32 | - [Prebuilt Images](#prebuilt-images)
33 | - [Multi Architecture](#multi-architecture)
34 | - [Configuration](#configuration)
35 | - [Quick Start](#quick-start)
36 | - [Persistent Storage](#persistent-storage)
37 | - [Environment Variables](#environment-variables)
38 | - [Base Images used](#base-images-used)
39 | - [Networking](#networking)
40 | - [Maintenance](#maintenance)
41 | - [Shell Access](#shell-access)
42 | - [Local Development / Changing Site Name \& Ports](#local-development--changing-site-name--ports)
43 | - [Command Line](#command-line)
44 | - [Support](#support)
45 | - [Usage](#usage)
46 | - [Bugfixes](#bugfixes)
47 | - [Feature Requests](#feature-requests)
48 | - [Updates](#updates)
49 | - [License](#license)
50 | - [Maintenance](#maintenance-1)
51 | - [Shell Access](#shell-access-1)
52 | - [References](#references)
53 |
54 | ## Prerequisites and Assumptions
55 | * Assumes you are using some sort of SSL terminating reverse proxy such as:
56 | * [Traefik](https://github.com/tiredofit/docker-traefik)
57 | * [Nginx](https://github.com/jc21/nginx-proxy-manager)
58 | * [Caddy](https://github.com/caddyserver/caddy)
59 |
60 | ## Installation
61 |
62 | ### Build from Source
63 | Clone this repository and build the image with `docker build (imagename) .`
64 |
65 | ### Prebuilt Images
66 | Builds of the image are available on [Docker Hub](https://hub.docker.com/r/tiredofit/wordpress)
67 |
68 | ```bash
69 | docker pull docker.io/tiredofit/wordpress:(imagetag)
70 | ```
71 |
72 | Builds of the image are also available on the [Github Container Registry](https://github.com/tiredofit/docker-wordpress/pkgs/container/docker-wordpress)
73 |
74 | ```
75 | docker pull ghcr.io/tiredofit/docker-wordpress:(imagetag)
76 | ```
77 |
78 | The following image tags are available along with their tagged release based on what's written in the [Changelog](CHANGELOG.md):
79 |
80 | | PHP version | OS | Tag |
81 | | ----------- | ------ | ---------- |
82 | | 8.3.x | Alpine | `:php-8.3` |
83 | | 8.2.x | Alpine | `:php-8.2` |
84 | | 8.1.x | Alpine | `:php-8.1` |
85 | | 8.0.x | Alpine | `:php-8.0` |
86 | | 7.4.x | Alpine | `:php-7.4` |
87 | | 7.3.x | Alpine | `:php-7.3` |
88 | | 7.2.x | Alpine | `:php-7.2` |
89 | | 7.1.x | Alpine | `:php-7.1` |
90 | | 7.0.x | Alpine | `:php-7.0` |
91 | | 5.6.x | Alpine | `:php5.6` |
92 |
93 | #### Multi Architecture
94 | 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](https://github.com/sponsors/tiredofit) my work so that I can work with various hardware. To see if this image supports multiple architecures, type `docker manifest (image):(tag)`
95 |
96 |
97 | ## Configuration
98 | ### Quick Start
99 |
100 | * The quickest way to get started is using [docker-compose](https://docs.docker.com/compose/). See the examples folder for a working [compose.yml](examples/compose.yml) that can be modified for development or production use.
101 |
102 | * Set various [environment variables](#environment-variables) to understand the capabilities of this image.
103 | * Map [persistent storage](#data-volumes) for access to configuration and data files for backup.
104 |
105 | ### Persistent Storage
106 |
107 | The following directories are used for configuration and can be mapped for persistent storage.
108 |
109 | | Directory | Description |
110 | | ---------------- | -------------------------- |
111 | | `/www/wordpress` | Root Wordpress Directory |
112 | | `/www/logs` | Nginx and php-fpm logfiles |
113 |
114 | ### Environment Variables
115 |
116 | #### Base Images used
117 |
118 | This image relies on an [Alpine Linux](https://hub.docker.com/r/tiredofit/alpine) base image that relies on an [init system](https://github.com/just-containers/s6-overlay) for added capabilities. Outgoing SMTP capabilities are handlded via `msmtp`. Individual container performance monitoring is performed by [zabbix-agent](https://zabbix.org). Additional tools include: `bash`,`curl`,`less`,`logrotate`,`nano`.
119 |
120 | Be sure to view the following repositories to understand all the customizable options:
121 |
122 | | Image | Description |
123 | | ------------------------------------------------------------- | -------------------------------------- |
124 | | [OS Base](https://github.com/tiredofit/docker-alpine/) | Customized Image based on Alpine Linux |
125 | | [Nginx](https://github.com/tiredofit/docker-nginx/) | Nginx webserver |
126 | | [PHP-FPM](https://github.com/tiredofit/docker-nginx-php-fpm/) | PHP Interpreter |
127 |
128 | | Parameter | Description | Default | `_FILE` |
129 | | ---------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------ | ------- |
130 | | `ADMIN_EMAIL` | Email address for the Administrator - Needed for initial startup | | x |
131 | | `ADMIN_USER` | Username for the Administrator - Needed for initial startup | `admin` | x |
132 | | `ADMIN_PASS` | Password for the Administrator - Needed for initial startup | | x |
133 | | `ENABLE_HTTPS_REVERSE_PROXY` | Tweak nginx to run behind a reverse proxy for URLs `TRUE` / `FALSE` | `TRUE` | |
134 | | `DB_CHARSET` | MariaDB character set for tables | `utf8mb4` | |
135 | | `DB_HOST` | MariaDB external container hostname (e.g. wordpress-db) | | x |
136 | | `DB_NAME` | MariaDB database name i.e. (e.g. wordpress) | | x |
137 | | `DB_USER` | MariaDB username for database (e.g. wordpress) | | x |
138 | | `DB_PASS` | MariaDB password for database (e.g. userpassword) | | x |
139 | | `DB_PORT` | MariaDB port for database | `3306` | x |
140 | | `DB_PREFIX` | MariaDB Prefix for `DB_NAME` | `wp_` | x |
141 | | `DEBUG_MODE` | Enable Debug Mode (verbosity) for the container installation/startup and in application - `TRUE` / `FALSE` | `FALSE` | |
142 | | `ROTATE_KEYS` | Rotate Salts and Keys on subsequent reboots `TRUE` / `FALSE` | `FALSE` | |
143 | | `SITE_LOCALE` | What Locale to set site | `en_US` | |
144 | | `SITE_PORT` | What Port does wordpress deliver assets to | `80` | |
145 | | `SITE_TITLE` | The title of the Website | `Docker Wordpress` | |
146 | | `SITE_URL` | The Full site URL of the installation e.g. `wordpress.example.com` - Needed for initial startup | | |
147 | | `SITE_URL_UPDATE_MODE` | After first install, perform modifications to wp-config.php and DB if different Site URL `FILE` `DB` `ALL` `NONE` | `ALL` | |
148 | | `UPDATE_MODE` | `ALL` to enable all major, minor updates, `MINOR` to only allow minor updates `NONE` to disable all updates | `minor` | |
149 |
150 | ### Networking
151 |
152 | The following ports are exposed.
153 |
154 | | Port | Description |
155 | | ---- | ----------- |
156 | | `80` | HTTP |
157 |
158 | * * *
159 | ## Maintenance
160 |
161 | ### Shell Access
162 |
163 | For debugging and maintenance purposes you may want access the containers shell.
164 |
165 | ```bash
166 | docker exec -it (whatever your container name is) bash
167 | ```
168 | ### Local Development / Changing Site Name & Ports
169 |
170 | 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:
171 |
172 | - `ENABLE_HTTPS_REVERSE_PROXY=FALSE`
173 | - `SITE_URL=localhost`
174 | - `SITE_PORT=8000` (or whatever port you are exposing)
175 |
176 | When you are ready to deploy to a production URL - you would change it as such:
177 | - `ENABLE_HTTPS_REVERSE_PROXY=TRUE`
178 | - `SITE_URL=www.domain.com`
179 |
180 | The system will rotate the URLs in the wordpress configuration files and database automatically upon restart of the container.
181 |
182 | ### Command Line
183 |
184 | If you wish to use the included wp-cli tool to perform maintenance use it as such:
185 |
186 | ````bash
187 | cd /www/wordpress
188 | wp-cli
189 | ````
190 |
191 | ## Support
192 |
193 | 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.
194 | ### Usage
195 | - The [Discussions board](../../discussions) is a great place for working with the community on tips and tricks of using this image.
196 | - Consider [sponsoring me](https://github.com/sponsors/tiredofit) for personalized support
197 | ### Bugfixes
198 | - Please, submit a [Bug Report](issues/new) if something isn't working as expected. I'll do my best to issue a fix in short order.
199 |
200 | ### Feature Requests
201 | - Feel free to submit a feature request, however there is no guarantee that it will be added, or at what timeline.
202 | - Consider [sponsoring me](https://github.com/sponsors/tiredofit) regarding development of features.
203 |
204 | ### Updates
205 | - Best effort to track upstream changes, More priority if I am actively using the image in a production environment.
206 | - Consider [sponsoring me](https://github.com/sponsors/tiredofit) for up to date releases.
207 |
208 | ## License
209 | MIT. See [LICENSE](LICENSE) for more details.
210 | ## Maintenance
211 | ### Shell Access
212 |
213 | For debugging and maintenance purposes you may want access the containers shell.
214 |
215 | ```bash
216 | docker exec -it (whatever your container name is e.g. wordpress) bash
217 | ```
218 |
219 | ## References
220 |
221 | * https://www.wordpress.org
222 | * http://www.wp-cli.org
223 |
--------------------------------------------------------------------------------
/examples/compose.yml:
--------------------------------------------------------------------------------
1 | services:
2 |
3 | wordpress-app:
4 | image: tiredofit/wordpress:latest
5 | container_name: wordpress-app
6 | labels:
7 | - traefik.enable=true
8 | - traefik.http.routers.wordpress.rule=Host(`wordpress.example.com`)
9 | - traefik.http.services.wordpress.loadbalancer.server.port=80
10 | links:
11 | - wordpress-db
12 | volumes:
13 | - ./data/:/www/wordpress
14 | - ./logs/:/www/logs
15 | environment:
16 |
17 | - CONTAINER_NAME=wordpress-app
18 | - DB_HOST=wordpress-db
19 | - DB_NAME=wordpress
20 | - DB_USER=wordpress
21 | - DB_PASS=userpassword
22 |
23 | - ENABLE_HTTPS_REVERSE_PROXY=FALSE
24 |
25 | - ADMIN_EMAIL=email@example.com
26 | - ADMIN_USER=admin
27 | - ADMIN_PASS=password
28 | - DEBUG_MODE=FALSE
29 | ### Enter this in as hostname.domain.tld or localhost if you are doing local development
30 | - SITE_URL=localhost
31 | - SITE_TITLE=Docker Wordpress
32 | ### This is next line is optional and only really used for local development - you would need to expose this port on your system to route to port 80
33 | ### If you are running a production system, get rid of thise environment variable entirely.
34 | #- SITE_PORT=8000
35 |
36 | - UPDATE_MODE=ALL
37 | networks:
38 | - proxy
39 | - services
40 | restart: always
41 |
42 | wordpress-db:
43 | image: tiredofit/mariadb
44 | container_name: wordpress-db
45 | volumes:
46 | - ./db:/var/lib/mysql
47 | environment:
48 | - ROOT_PASS=password
49 | - DB_NAME=wordpress
50 | - DB_USER=wordpress
51 | - DB_PASS=userpassword
52 |
53 | - CONTAINER_NAME=wordpress-db
54 | networks:
55 | - services
56 | restart: always
57 |
58 | wordpress-db-backup:
59 | container_name: wordpress-db-backup
60 | image: tiredofit/db-backup
61 | links:
62 | - wordpress-db
63 | volumes:
64 | - ./dbbackup:/backup
65 | environment:
66 | - DB_HOST=wordpress-db
67 | - DB_TYPE=mariadb
68 | - DB_NAME=wordpress
69 | - DB_USER=wordpress
70 | - DB_PASS=userpassword
71 | - DB_DUMP_FREQ=1440
72 | - DB_DUMP_BEGIN=0000
73 | - DB_CLEANUP_TIME=8640
74 | - COMPRESSION=BZ
75 | networks:
76 | - services
77 | restart: always
78 |
79 | networks:
80 | proxy:
81 | external: true
82 | services:
83 | external: true
84 |
--------------------------------------------------------------------------------
/install/assets/defaults/30-wordpress:
--------------------------------------------------------------------------------
1 | #!/command/with-contenv bash
2 |
3 | ### Set Defaults
4 | ADMIN_USER=${ADMIN_USER:-"admin"}
5 | ENABLE_HTTPS_REVERSE_PROXY=${ENABLE_HTTPS_REVERSE_PROXY:-"TRUE"}
6 | DB_CHARSET=${DB_CHARSET:-"utf8mb4"}
7 | DB_PREFIX=${DB_PREFIX:-"wp_"}
8 | DB_PORT=${DB_PORT:-"3306"}
9 | ROTATE_KEYS=${ROTATE_KEYS:-"FALSE"}
10 | SITE_TITLE=${SITE_TITLE:-"Wordpress Docker Site"}
11 | SITE_LOCALE=${SITE_LOCALE:-"en_US"}
12 | SITE_URL_UPDATE_MODE=${SITE_URL_UPDATE_MODE="ALL"}
13 | UPDATE_MODE=${UPDATE_MODE:-"minor"}
14 |
15 | if [ -n "$SITE_PORT" ]; then
16 | SITE_PORT=":${SITE_PORT}"
17 | fi
18 |
--------------------------------------------------------------------------------
/install/assets/functions/30-wordpress:
--------------------------------------------------------------------------------
1 | #!/command/with-contenv bash
2 |
3 | bootstrap_filesystem() {
4 | mkdir -p "${NGINX_WEBROOT}"
5 | chown "${NGINX_USER}":"${NGINX_GROUP}" "${NGINX_WEBROOT}"
6 | }
7 |
8 | configure_nginx() {
9 | ### Perform Nginx reverse proxy modifications
10 | if var_true "${ENABLE_HTTPS_REVERSE_PROXY}" ; then
11 | sed -i "s|^fastcgi_param HTTPS .*$|fastcgi_param HTTPS 'on';|g" /etc/nginx/fastcgi_params
12 | PROTOCOL="https://"
13 | else
14 | print_warn "Disabling Nginx Reverse Proxy HTTPS Termination Support"
15 | sed -i "s|^fastcgi_param HTTPS .*$|fastcgi_param HTTPS 'off';|g" /etc/nginx/fastcgi_params
16 | PROTOCOL="http://"
17 | fi
18 | }
19 |
20 | create_bash_alias() {
21 | cat >> /root/.bashrc <
2 |
3 | 3.4
4 | 2018-02-02T19:02:37Z
5 |
6 |
7 | Templates
8 |
9 |
10 | Websites
11 |
12 |
13 |
14 |
15 | APP - Wordpress
16 | APP - Wordpress
17 |
18 |
19 |
20 | Templates
21 |
22 |
23 | Websites
24 |
25 |
26 |
27 |
28 | Wordpress
29 |
30 |
31 |
32 |
33 |
34 | Wordpress instances
35 | 0
36 |
37 |
38 | file.discovery[/www/wordpress,XndwLWNvbmZpZy5waHAk]
39 | 1d
40 | 0
41 |
42 |
43 |
44 | 0
45 | 0
46 |
47 | 0
48 |
49 |
50 |
51 | 0
52 |
53 |
54 |
55 |
56 |
57 |
58 | 0
59 |
60 |
61 |
62 | 0
63 |
64 |
65 |
66 | Update Status
67 | 0
68 |
69 |
70 | wp.update_available[{#FDIR}]
71 | 0;wd1-5h10
72 | 30d
73 | 0
74 | 0
75 | 4
76 |
77 |
78 |
79 |
80 | 0
81 | 0
82 |
83 | 0
84 |
85 |
86 |
87 | 0
88 |
89 |
90 |
91 |
92 |
93 |
94 | 0
95 |
96 |
97 | Wordpress
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | {APP - Wordpress:wp.update_available[{#FDIR}].nodata(129600)}=1
111 | 0
112 |
113 | No update status data available
114 | 0
115 |
116 |
117 | 0
118 | 1
119 |
120 | 0
121 | 1
122 |
123 |
124 |
125 |
126 | {APP - Wordpress:wp.update_available[{#FDIR}].regexp(^OK$)}=0
127 | 0
128 |
129 | Wordpress update available
130 | 0
131 |
132 |
133 | 0
134 | 1
135 |
136 | 0
137 | 1
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
--------------------------------------------------------------------------------