GithubHelp home page GithubHelp logo

cyberpearuk / wordpress-docker Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 56 KB

Docker image for WordPress using Apache Server

License: GNU General Public License v3.0

Dockerfile 50.71% Shell 30.19% PHP 19.10%
wordpress-installation wordpress devops ci mod-security docker

wordpress-docker's Introduction

Custom WordPress Docker Image

Tailored docker image for running wordpress.

Comes with security steps built in.

Environment Variables

Mountable Environment Variables

This image supports the ability to load environment variables at startup from a predefined locations.

This allows loading shared/common settings from the host machine by mounting an external .env file to the required path /var/common/.env.

These are loaded in the entrypoint script at machine startup.

Email Settings

  • EMAIL_SMTP_HOST - Remote SMTP Server host name
  • EMAIL_SMTP_PORT - Remote SMTP Port
  • EMAIL_AUTH_USER - Remote SMTP Username
  • EMAIL_AUTH_PASS - Remote SMTP User Password
  • EMAIL_HOST - The host of the email

For my purposes TLS is on and not configurable out the box.

Web Server

  • VIRTUAL_HOST - The server host name (used for ServerName)

Notes

Ephemeral WordPress Installation

With the official image, WordPress is actually installed on first run

  • i.e. it copies across WordPress if it's not in the installation directory already.

This image comes with WordPress installed already. The WordPress installation is therefore ephemeral as we are only setting up a volume for the wp-content directory, not the entire WordPress install. This means that the image itself controls the WordPress version, this can make it easier to control exactly what is running and where (one of the main benefits of Docker!).

Dynamic Environment Variables

The official image only uses the environment variables the first time (therefore the environment variables become meaningless after the first run).

The environment variables in this image continue to be referenced, i.e. if you change your database creds, all you need to do is update the environment variables and restart (in the official WP you'd have to change them inside the running container).

To achieve this wp-config.php is also ephemeral as it uses the environment variables directly from PHP. The installation specific content such as the WordPress salts are put in a separate volume.

Mod Security

This image has a basic setup of mod security with it's apache setup.

Sendmail

As this container was originally created to help support sending emails it includes a bash script test-sendmail <email-address> which will send a test email both via PHP but also sendmail directly (over bash CLI).

docker exec -it <container> test-sendmail [email protected]

Maintainer

This repository is maintained by Black Pear Digital.

wordpress-docker's People

Contributors

jbuncle avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.