Sign inSign up

xplodwild/optimized-wordpress

By xplodwild

Updated over 3 years ago

Optimized WordPress with NGiNX and PHP-FPM

Image
0

1.3K

xplodwild/optimized-wordpress repository overview

tiredofit/wordpress

Introduction

Dockerfile to build a Wordpress container image.

It will automatically download the latest wordpress release upon build, and if you have set correct environment variables, will autocreate a database if you wish.

This Container uses Alpine:Edge as a base. Additional Components are PHP7 w/ APC, OpCache, Support - WP-CLI and MySQL Client is also available.

Changelog

Authors

Table of Contents

Prerequisites

This image relies on an external MySQL Server, external SMTP Server, and is meant to be run behind a reverse SSL Proxy such as nginx-proxy.

Installation

Automated builds of the image are available on Registry and is the recommended method of installation.

docker pull tiredofit/wordpress

Quick Start

Configuration

Data-Volumes

The following directories are used for configuration and can be mapped for persistent storage.

DirectoryDescription
/www/wordpressRoot Wordpress Directory
/www/logsNginx and php-fpm logfiles
Database

This container requires the usage of an external database. Set one up accordingly.

CREATE USER 'wordpress'@'%.%.%.%' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS `wordpress` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
GRANT ALL PRIVILEGES ON `wordpress`.* TO 'wordpress'@'%.%.%.%';
Environment Variables

Below is the complete list of available options that can be used to customize your installation.

ParameterDescription
PHP_MEMORY_LIMITAmount of memory php-fpm process should use (Default 128M)
UPLOAD_MAX_SIZEMaximum Upload Size: (Default 2G)
APC_SHM_SIZEPHP7 APC SHM Cache Size: (Default 128M)
OPCACHE_MEM_SIZEPHP7 OPCache Size (Default 128)
TZTimezone - Use Unix Timezone format (Default America/Vancouver)
DB_HOSTMySQL external container hostname (e.g. wordpress1-db)
DB_NAMEMySQL database name i.e. (e.g. wordpress)
DB_USERMySQL username for database (e.g. wordpress)
DB_PASSMySQL password for database (e.g. userpassword)
Networking

The following ports are exposed.

PortDescription
80HTTP

Maintenance

Shell Access

For debugging and maintenance purposes you may want access the containers shell.

docker exec -it (whatever your container name is e.g. wordpress) bash

References

Tag summary

Content type

Image

Digest

sha256:c4c636830

Size

94.8 MB

Last updated

over 3 years ago

docker pull xplodwild/optimized-wordpress