Docker Community Forums

Share and learn in the Docker community.

Local Development Guide from Github repo messed up?

I don’t know what went wrong when I followed this instructions on a github repo: GitHub - richtabor/building-blocks: Exploring the foundations of Gutenberg block development.

A. First, you need a WordPress Environment to run this plugin and start block development. The quickest way to get up and running is to use the provided docker setup. Install docker-ce and docker-compose (if necessary) by following the most recent instructions on the Docker site.

B. Start Docker on your machine.

C. In the folder of your preference, clone this project and enter the working directory:

git clone https://github.com/richtabor/building-blocks.git
cd building-blocks

D. To start this local WordPress instance, run within the project: docker-compose up -d . Once started, WordPress should now be available at http://localhost:9999 . Note: When we’re done, run docker-compose stop to stop this local setup.

I clearly followed the steps. I did download docker desktop for mac. However, I’m not really sure about this docker-ce and docker-compose but decided that docker desktop for mac that I download already have those things. So I ran docker-compose up -d and went to the localhost but I got this error message:

Error establishing a database connection

So I looked at the docker-compost.yml in the github repo that I cloned to my local folder and here’s what it showed:

version: '3.1'

services:

  wordpress:
    image: wordpress
    ports:
      - 9999:80
    environment:
      WORDPRESS_DB_PASSWORD: password
    volumes:
      - ./:/var/www/html/wp-content/plugins/building-blocks
      - ./wp-content:/var/www/html/wp-content

  mysql:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: password

So I concluded that maybe there’s a problem with the docker-compose.yml file?

How do I fix this?