All Projects → selloween → docker-multi-wordpress

selloween / docker-multi-wordpress

Licence: GPL-3.0 license
Run multiple WordPress Docker containers with NGINX Proxy, LetsEncrypt and PHP Composer

Programming Languages

PHP
23972 projects - #3 most used programming language
Dockerfile
14818 projects
hack
652 projects
CSS
56736 projects

Projects that are alternatives of or similar to docker-multi-wordpress

alpine-php-fpm
Lightweight and optimised PHP-FPM (PHP 7.4, 8.0, 8.1) Docker images with essential extensions on top of latest Alpine Linux.
Stars: ✭ 53 (-15.87%)
Mutual labels:  composer
lean-theme
No description or website provided.
Stars: ✭ 38 (-39.68%)
Mutual labels:  composer
stock-api-libphp
PHP implementation of the Stock APIs
Stars: ✭ 16 (-74.6%)
Mutual labels:  composer
app
Aplus Framework App Project
Stars: ✭ 338 (+436.51%)
Mutual labels:  composer
itsgoingto.be
The magic behind itsgoingto.be
Stars: ✭ 13 (-79.37%)
Mutual labels:  composer
wp-skeleton
Setup a new WordPress installation via Composer
Stars: ✭ 36 (-42.86%)
Mutual labels:  composer
wordpress-scaffold
The scaffold for GRRR's WordPress Pro setup.
Stars: ✭ 16 (-74.6%)
Mutual labels:  composer
tdee-calculator
TDEE Calculator is a composer library that calculates how much energy (calories) are burned daily given the weight, height and age or Lean Body Mass.
Stars: ✭ 16 (-74.6%)
Mutual labels:  composer
php8-xdebug
PHP 8.0 for development and production usage. With nginx, brotli, xdebug, JIT and more...
Stars: ✭ 17 (-73.02%)
Mutual labels:  composer
jadibot
Telegram Bot for jadi.net
Stars: ✭ 59 (-6.35%)
Mutual labels:  composer
homify
🏡 Open-source home automation / smarthome platform running on PHP (Laravel).
Stars: ✭ 45 (-28.57%)
Mutual labels:  composer
PackageChangeLog
Show Package Changelog On Composer Install/update
Stars: ✭ 15 (-76.19%)
Mutual labels:  composer
drupal8-composer-template
Project template for Drupal 8 projects with composer | Quick installation via "composer create-project woprrr/drupal8-composer-template:8.3.0"
Stars: ✭ 27 (-57.14%)
Mutual labels:  composer
laration
Simple package to see all current configurations being used by your Laravel application
Stars: ✭ 47 (-25.4%)
Mutual labels:  composer
internetarchivebot
iabot.toolforge.org
Stars: ✭ 67 (+6.35%)
Mutual labels:  composer
flask-template
Template for creating Flask based projects
Stars: ✭ 60 (-4.76%)
Mutual labels:  docker-setup
composer-cost
Displays cost/size of each composer package installed.
Stars: ✭ 31 (-50.79%)
Mutual labels:  composer
package-command
Lists, installs, and removes WP-CLI packages.
Stars: ✭ 16 (-74.6%)
Mutual labels:  composer
ACCESS-NYC
Find help in NYC with food, money, housing, work, and more on ACCESS NYC. Maintained by @NYCOpportunity
Stars: ✭ 27 (-57.14%)
Mutual labels:  composer
autoload
Aplus Framework Autoload Library
Stars: ✭ 18 (-71.43%)
Mutual labels:  composer

Run multiple WordPress Docker containers with NGINX Proxy, LetsEncrypt and PHP Composer

Each WordPress site runs its own container and is proxied by an NGINX Proxy that handles SSL thanks to LetsEncrypt. This setup relies on https://github.com/jwilder/nginx-proxy and https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion

Requirements

  • Docker
  • Docker Compose

NGINX Proxy and LetsEncrypt

Run docker-compose up -d in the nginx directory to start the NGINX Proxy and LetsEncrypt Proxy Companion containers. These containers will handle https.

WordPress Setup

  • Copy the wordpress_01 directory for each WordPress site you want to host. I created a copy called wordpress_02 as an example. If you only want to host one site you can delete wordpress_02 and modify wordpress_01 to your liking.

  • In each site directory is a sample.env - copy that file, edit the environment variables and rename it to .env. Each site directory must contain this environment file.

  • Make sure that the container names are unique for each site. (DB_CONTAINER, WP_CONTAINER and COMPOSER_CONTAINER).

  • I recommend highly choosing different database credentials for each site.

  • Make optional changes to wp-config.php

  • The wp-content folder is mounted locally to /srv/www/${VIRTUAL_HOST}/wp_content for persistency. This folder contains themes, plugins and uploads.

  • Database files are mounted here: /srv/www/${VIRTUAL_HOST}/db_data

Custom Theme & Plugin Development

  • You can develop a custom theme in wordpress_XX/theme or a custom plugin in wordpress_XX/plugin. Theme and plugin are named after the according environment variable defined in .env (WP_THEME and WP_PLUGIN)

Composer

Add plugins and/or theme dependencies to wordpress_XX/composer/composer.json They will be installed by the composer container on docker-compose up --build I've added common plugins from https://wpackagist.org/ repository as an example.

{
    "name": "wordpress-docker-composer",
    "description": "WordPress Docker & Composer Setup",
    "repositories":[
        {
            "type":"composer",
            "url":"https://wpackagist.org"
        }
    ],
    "require": {
        "wpackagist-plugin/wordpress-seo":"*",
        "wpackagist-plugin/wp-super-cache":"*"
    }
}

Build and run containers.

For each site navigate to its directory and:

docker-compose up --build

Local Development

For local development set the values of VIRTUAL_HOSTand LETSENCRYPT_HOST environment variables to a arbitrary domain. (e.g. my-wordpress.com) and set LETSENCRYPT_TEST to true. Make sure to use a valid domain ending and to add the domain to your hosts file. On Linux or MacOS add this line 127.0.0.1 my-wordpress.com to /etc/hosts and restart the browser. On Windows the hosts file is located here - C:\Windows\System32\drivers\etc\hosts

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].