Skip to content

michaelolsonengineer/local-wordpress-development

Repository files navigation

local-wordpress-development

Another Docker Configuration for Local WordPress development

Installation - In progress

Prerequisites

  • Install Git
    • if Linux and debian/ubuntu
      • sudo apt install git
  • Install Docker
  • Install Docker Compose
  • Install mkcert
    • If Ubuntu/Debian,
      • sudo apt install golang is needed to build to install mkcert
  • Install yq
    • If Ubuntu/Debian,
      • sudo apt-get update && sudo apt-get install -y yq

Initialization

  • 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

Build/Run

  • if first time
    • docker compose up --build
  • else
    • docker compose up

Troubleshooting and Helpful Tips

  • 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

Know some basic docker commands

  • 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

Acknowledgments

About

A Docker Configuration for Local WordPress development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages