Build a Wordpress development environment with Docker

Introduction

It is assumed that Docker is already installed. You can build an environment quickly when developing a Wordpress theme.

Mac 0SX Docker 19.03.13

Environment

Create the following docker-compose.yml in the directory where you want to create the environment.

docker-compose.yml


version: "2"

services:
  wordpress:
    image: wordpress:latest
    ports:
      - "3001:80"
    depends_on:
      - mysql
    env_file: .env
    volumes:
      - ./wp-content:/var/www/html/wp-content

  mysql:
    image: mysql:5.7
    env_file: .env
    ports:
      - "3306:3306"

Go to the directory where you created docker-compose.yml and run the docker-compose command.

bash


$cd directory of created files
$ docker-compose build
$ docker-compose up

Access and set up with a browser

I think that the environment has started up with this, so access it with the following URL and build the site name and DB. http://localhost:3001/

Then, the following folder will be created.

python


├── docker-compose.yml
└── wp-content
    ├── index.php
    ├── languages
    ├── plugins
    ├── themes
    ├── upgrade
    └── uploads

When developing a theme, you can modify the theme in wp-content / themes.

It is quick and convenient to launch the second migration by clicking the execute button from the Docker dashboard. You can also stop it from the dashboard.

If you want to change php.ini etc., you can connect to the container by clicking the "CLI" button displayed on the right side of wordpress_wordpress_1 on the dashboard, and you can edit it using vi etc. from there.

dashboard.png

At the end

Please point out any mistakes.

Recommended Posts

Build a Wordpress development environment with Docker
Build a WordPress development environment quickly with Docker
Build a PureScript development environment with Docker
Build a Node.js environment with Docker
Build a simple Docker + Django development environment
Build a development environment for Docker + Rails6 + Postgresql
Build a Laravel / Docker environment with VSCode devcontainer
Build a simple Docker Compose + Django development environment
Build docker environment with WSL
[Win10] Build a JSF development environment with NetBeans
Build a development environment for Django + MySQL + nginx with Docker Compose
Build a development environment for Docker, java, vscode
[First team development ②] Build an environment with Docker
Wordpress local environment construction & development procedure with Docker
Create a Spring Boot development environment with docker
Build a Java development environment with VS Code
I tried to build a Firebase application development environment with Docker in 2020
[Copy and paste] Build a Laravel development environment with Docker Compose Part 2
How to build a Ruby on Rails development environment with Docker (Rails 6.x)
Build a local development environment for Rails tutorials with Docker (Rails 6 + PostgreSQL + Webpack)
[Copy and paste] Build a Laravel development environment with Docker Compose Participation
How to build a Ruby on Rails development environment with Docker (Rails 5.x)
Template: Build a Ruby / Rails development environment with a Docker container (Ubuntu version)
Template: Build a Ruby / Rails development environment with a Docker container (Mac version)
Easily build a Vue.js environment with Docker + Vue CLI
[Note] Build a Python3 environment with Docker in EC2
Build Java development environment with WSL2 Docker VS Code
[Docker] Build a Wordpress environment locally (Win, Mac) quickly
[Environment construction] Build a Java development environment with VS Code!
Build WordPress environment with Docker (Local) and AWS (Production)
Try to build a Java development environment using Docker
Create a Vue3 environment with Docker!
Build Couchbase local environment with Docker
Build a Tomcat 8.5 environment with Pleiades 4.8
Build PlantUML environment with VSCode + Docker
Build environment with vue.js + rails + docker
Build Rails environment with Docker Compose
Build jooby development environment with Eclipse
Build Unity development environment on docker
Build docker + laravel environment with laradock
Build a development environment to create Ruby on Jets + React apps with Docker
Build a "Spring Thorough Introduction" development environment with IntelliJ IDEA
How to build Rails, Postgres, ElasticSearch development environment with Docker
Build a Node-RED environment with Docker to move and understand
I tried to create a padrino development environment with Docker
Until you build a Nuxt.js development environment with Docker and touch it with VS Code
[Rails] [Docker] Copy and paste is OK! How to build a Rails development environment with Docker
Laravel development environment construction with Docker (Mac)
Build a local development environment for Open Distro for Elasticsearch with multiple nodes using Docker
Create a MySQL environment with Docker from 0-> 1
Build a WAS execution environment from Docker
Create Spring Boot-gradle-mysql development environment with Docker
Build a Java development environment on Mac
How to quit Docker for Mac and build a Docker development environment with Ubuntu + Vagrant
[Docker] Build Jupyter Lab execution environment with Docker
Build an environment with Docker on AWS
Build an Ultra96v2 development environment on Docker 1
Lightweight PHP 7.4 development environment created with Docker
Build TensorFlow operation check environment with Docker
How to build Rails 6 environment with Docker
Build Go development environment with WSL2 + Docker Desktop + VSCode (Remote --Containers)