This repository will build a conatiner image for running Laravel applications either in a development or production capacity, including Nginx w/PHP-FPM.
- About
- Maintainer
- Table of Contents
- Prerequisites and Assumptions
- Installation
- Configuration
- Maintenance
- Support & Maintenance
- License
- References
Feature limited builds of the image are available on the Github Container Registry and Docker Hub.
To unlock advanced features, one must provide a code to be able to change specific environment variables from defaults. Support the development to gain access to a code.
To get access to the image use your container orchestrator to pull from the following locations:
ghcr.io/nfrastack/container-laravel:(image_tag)
docker.io/nfrastack/laravel:(image_tag)
Image tag syntax is:
<image>:<optional tag>-<optional phpversion>-<optional distro>-<optional distro_variant>
Example:
docker.io/nfrastack/container-laravel:latest
or
ghcr.io/nfrastack/container-laravel:1.0-php84-alpine
-
latest
will be the most recent commit -
An optional
tag
may exist that matches the CHANGELOG - These are the safest
PHP version | OS | Tag |
---|---|---|
8.4.x | Alpine | :php8.4 |
Have a look at the container registries and see what tags are available.
Images are built for amd64
by default, with optional support for arm64
and other architectures.
-
The quickest way to get started is using docker-compose. See the examples folder for a working compose.yml that can be modified for your use.
-
Map persistent storage for access to configuration and data files for backup.
-
Set various environment variables to understand the capabilities of this image.
The following directories/files should be mapped for persistent storage in order to utilize the container effectively.
Directory | Description |
---|---|
/www/wordpress |
Root Wordpress Directory |
/logs |
Nginx and php-fpm logfiles |
This image relies on a customized base image in order to work. Be sure to view the following repositories to understand all the customizable options:
Image | Description |
---|---|
OS Base | Base Image |
Nginx | Nginx Webserver |
Nginx PHP-FPM | PHP-FPM Interpreter |
Below is the complete list of available options that can be used to customize your installation.
- Variables showing an 'x' under the
Advanced
column can only be set if the containers advanced functionality is enabled.
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 |
For debugging and maintenance, bash
and sh
are available in the container.
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>
- For community help, tips, and community discussions, visit the Discussions board.
- For personalized support or a support agreement, see Nfrastack Support.
- To report bugs, submit a Bug Report. Usage questions will be closed as not-a-bug.
- Feature requests are welcome, but not guaranteed. For prioritized development, consider a support agreement.
- Updates are best-effort, with priority given to active production use and support agreements.
This project is licensed under the MIT License - see the LICENSE file for details.
This will build a Docker Image for Wordpress. A web based content management system. It will:
- Automatically Download latest version of Wordpress
- Configure
wp-config.php
for you - Install Database
- Configure the website with basic information
- Automatically rotate URLs on subsequent boots if they have changed
- Includes WP-CLI
- About
- Maintainer
- Table of Contents
- Prerequisites and Assumptions
- Installation
- Configuration
- Maintenance
- Support
- License
- Maintenance
- References
Clone 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:
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 |
---|
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.
- The Discussions board is a great place for working with the community on tips and tricks of using this image.
- Consider sponsoring me for personalized support
- Please, submit a Bug Report if something isn't working as expected. I'll do my best to issue a fix in short order.
- Feel free to submit a feature request, however there is no guarantee that it will be added, or at what timeline.
- Consider sponsoring me regarding development of features.
- Best effort to track upstream changes, More priority if I am actively using the image in a production environment.
- Consider sponsoring me for up to date releases.
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