Giter Site home page Giter Site logo

deeptradingfx / docker-wordpress Goto Github PK

View Code? Open in Web Editor NEW

This project forked from felixcarmona/docker-wordpress

0.0 1.0 0.0 48 KB

๐Ÿ‹ NGINX-PROXY(SSL) + VARNISH + NGINX + PHP-FPM + MYSQL

License: MIT License

Makefile 24.70% VCL 37.75% Shell 37.55%

docker-wordpress's Introduction

docker-wordpress

NGINX-PROXY(SSL) + VARNISH + NGINX + PHP-FPM + MYSQL

Build Status

Build

  • DOMAIN=example.com make up
  • DOMAIN=example.com make down
  • DOMAIN=example.com make restart
  • DOMAIN=example.com make destroy # CAUTION: will destroy all the containers and volumes.

Note: don't prefix the domain with www.

Shell

  • DOMAIN=example.com make sh-nginx
  • DOMAIN=example.com make sh-php
  • DOMAIN=example.com make sh-mysql
  • DOMAIN=example.com make sh-varnish
  • DOMAIN=example.com make sh-exim

Configuration

.env configurable/default values:

WORDPRESS_VERSION=4.9.2
W3_TOTAL_CACHE_VERSION=0.9.6
PHP_VERSION=7.2
MYSQL_VERSION=5.7
NGINX_VERSION=1.13
ALPINE_VERSION=3.7

MYSQL_ROOT_PASSWORD=root_password
MYSQL_DATABASE=wordpress
MYSQL_USER=username
MYSQL_PASSWORD=password

VARNISH_MEMORY=100M

EXIM_DNS=8.8.8.8

nginx-proxy

This docker-wordpress project supports having multiple wordpress instances with different domain names.

nginx-proxy serves as HTTP Proxy + DNS server in order to dispatch the HTTP request to right the wordpress instance (based on the domain)

  • make nginx-proxy-start
  • make nginx-proxy-stop
  • make nginx-proxy-restart

Note: These commands will only work on Linux hosts (won't work on MacOS/Windows).

Tip: If you are using MacOS as host server, consider using dinghy (which includes the adapted implementation dinghy-http-proxy) instead of Docker for Mac.

SSL

nginx-proxy is in front of Varnish and will receive the https requests, decrypt them, and send them to Varnish converted as http requests.

Finally will encrypt the response before sending it to the client.

Put your cert files .crt and .key in the path ./certs/{DOMAIN}.crt and ./certs/{DOMAIN}.key

For example: ./certs/one.example.com.crt and ./certs/one.example.com.key

Note: remember to restart the nginx-proxy after any cert modification

Varnish

Varnish is a web application accelerator also known as a caching HTTP reverse proxy.

It's in front of the nginx server and caches the HTTP responses:

It receives requests from clients and tries to answer them from the cache. If it cannot answer from the cache it will forward it to the nginx server + php-fpm, fetch the response, store it in cache and deliver it to the client.

When Varnish has a cached response ready, it is typically delivered in a matter of microseconds

The wordpress container includes a wordpress plugin (W3 Total Cache) to invalidate the cache after any content change.

You should enable the plugin after the installation (Plugins โ†’ Installed Plugins) pressing the Activate button under the W3 Total Cache row. Then press on the Settings under the same plugin row and search the Reverse Proxy section. Enable the checkbox Enable reverse proxy caching via varnish and in the Varnish servers text area just type varnish and press the Save all settings button.

Note: It requires having permalinks enabled (Settings โ†’ Permalinks). Choose one that is not the first (Plain)

Backups

  • DOMAIN=example.com make backup
  • DOMAIN=example.com make backup-code
  • DOMAIN=example.com make backup-mysql

will generate in backups/ the filescode.tar.gz and dump.sql.gz

  • DOMAIN=example.com make recover
  • DOMAIN=example.com make recover-code
  • DOMAIN=example.com make recover-mysql

will recover the backups from backups/ with the files code.tar.gz and dump.sql.gz

Install docker + docker_compose

  • ubuntu: make docker-install-ubuntu

docker-wordpress's People

Contributors

felixcarmona avatar

Watchers

James Cloos 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.