Local folder structure

ls my-wordpress-blog

  • wp-content (Your themes, presumably copied from your existing live WordPress site)
  • Dockerfile
  • docker-compose.yml

docker-compose.yml

version: '2'
services:
    web:
        container_name: wp_web
        build: ./
        links:
         - mysql
        environment:
         - WORDPRESS_DB_PASSWORD=password
        ports:
         - "3000:80"
        working_dir: /var/www/html
        volumes:
         - ./wp-content/:/var/www/html/wp-content
    mysql:
        image: mysql:5.7
        environment:
         - MYSQL_ROOT_PASSWORD=password
         - MYSQL_DATABASE=wordpress

Dockerfile

FROM wordpress:4.7.3-apache
COPY wp-content/ /var/www/html/wp-content
VOLUME ["/var/www/html"]

Run it!

Run the command

docker-compose up -d

Access your site at localhost:3000