Another Docker Configuration for Local WordPress development
- Install Git
- if Linux and debian/ubuntu
sudo apt install git
- if Linux and debian/ubuntu
- Install Docker
- Install Docker Compose
- Install mkcert
- If Ubuntu/Debian,
sudo apt install golangis needed to build to install mkcert
- If Ubuntu/Debian,
- Install yq
- If Ubuntu/Debian,
- sudo apt-get update && sudo apt-get install -y yq
- If Ubuntu/Debian,
- Clone this repository
- Copy env.example to .env on host environment at root of workspace of desired server
- Edit newly created .env with desired secret credentials
- NOTE: if local development only, then create self-signed certificates
- if first time
docker compose up --build
- else
docker compose up
-
Do not edit docker configurations while docker is running.
- Bring system down before editing. It can cause docker compose to have difficulty finding containers for example.
-
Make sure to stop any local running databases that might conflict with databases defined in the docker compose files.
- i.e.
sudo systemctl stop mysql
- i.e.
docker container ls- list containers
docker volume ls- list volumes
docker log <CONTAINER_NAME>- show system logs till now of CONTAINER_NAME
docker ps -a- show any existing running containers
docker volume prune- remove any dangling volumes if existing
docker rm $(docker ps -a -f status=exited -q)- remove any exited containers if existing
- If you are needing to really nuke, know how to do that with docker and/or make the scripts
docker volume rm $DIRECTORY_NAME_wordpress $DIRECTORY_NAME_dbdata- i.e
docker volume rm wp_wordpress wp_dbdata
-
Repo originally started from - Wazoo's Github Repo of Local Wordpress development
- Going off of material from Docker Setup for Local WordPress Development for step-by-step guide
- And Adding SSL to Wordpress (aka pt2) which will need a self-signed certificates tool local development
-
And mixing with How To Install WordPress With Docker Compose another step-by-step for refresher
-
and my own docker experience since it had been some 3+ years since I have worked with docker and web stuff