META

A simple Docker setup for WordPress!

View the Project on GitHub FJrodafo/META

META ▲Vercel

GitHub Pages GitHub Stars

PageSpeed Insights

Docker Container Docker Pulls Image Size

Index

  1. Introduction
  2. Project structure
  3. Clone the repository
  4. Set up the project
  5. Hosts configuration
  6. Docker + WordPress

Introduction

A simple Docker setup for WordPress!

This project has been developed on a Linux system. To learn more about the system, visit the Dotfiles repository.

Project structure

/
├── docs/
│   └── *.md
├── nginx/
│   ├── conf.d/
│   │   └── default.config
│   └── Dockerfile
├── wordpress/
│   ├── .../
│   │   └── ...
│   └── index.html
├── CONTRIBUTING
├── LICENSE
├── .dockerignore
├── .env
└── docker-compose.yaml

Clone the repository

Open a terminal in the directory where you store your repositories and clone it with the following command:

# HTTPS
git clone https://github.com/FJrodafo/META.git
cd META/
# SSH
git clone git@github.com:FJrodafo/META.git
cd META/

Set up the project

Copy .env.example to .env and fill the credentials:

cp .env.example .env
nano .env

Hosts configuration

A custom local domain is required to access WordPress.

sudo nano /etc/hosts

Add the following lines to your /etc/hosts file:

127.0.0.1	wp.metachannelcorp.com	wp.metachannelcorporation.com
127.0.0.1	wp.metachannelcorp.ie	wp.metachannelcorporation.ie

Docker + WordPress

You can find a Docker image of this project ready to be pulled on GitHub Packages or Docker Hub official website!

Pull the latest image with the following commands:

# GitHub Packages
docker pull ghcr.io/fjrodafo/meta-wp-nginx:latest
# Docker Hub
docker pull fjrodafo/meta-wp-nginx:latest

Make sure you have created and configured the .env file correctly before continuing.

Build the container:

docker compose build

[!NOTE]

If you want to build the image locally, uncomment the build section in docker-compose.yaml and run docker compose build. Otherwise, skip directly to the next step.

Run the container:

docker compose up -d

[!NOTE]

WordPress: http://wp.metachannelcorp.com

phpMyAdmin: http://wp.metachannelcorp.com:8080

Stop the Container:

docker compose down

Build & Push (Ignore this subsection)

docker build \
  -t ghcr.io/fjrodafo/meta-wp-nginx:1 \
  -t ghcr.io/fjrodafo/meta-wp-nginx:1.0 \
  -t ghcr.io/fjrodafo/meta-wp-nginx:1.0.0 \
  -t ghcr.io/fjrodafo/meta-wp-nginx:latest \
  -t fjrodafo/meta-wp-nginx:1.0.0 \
  -t fjrodafo/meta-wp-nginx:latest \
  ./nginx

docker push ghcr.io/fjrodafo/meta-wp-nginx:1
docker push ghcr.io/fjrodafo/meta-wp-nginx:1.0
docker push ghcr.io/fjrodafo/meta-wp-nginx:1.0.0
docker push ghcr.io/fjrodafo/meta-wp-nginx:latest
docker push fjrodafo/meta-wp-nginx:1.0.0
docker push fjrodafo/meta-wp-nginx:latest