Skip to content

Instantly share code, notes, and snippets.

@tarecord
Created November 27, 2018 20:22
Show Gist options
  • Save tarecord/33cd60044e279ca491258a4b74b47f5b to your computer and use it in GitHub Desktop.
Save tarecord/33cd60044e279ca491258a4b74b47f5b to your computer and use it in GitHub Desktop.
A docker-compose configuration for spinning up local WordPress sites
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- ./mysql:/var/lib/mysql
ports:
- "3306:3306"
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress
MYSQL_USER: user
MYSQL_PASSWORD: password
wordpress:
depends_on:
- db
image: wordpress:latest
volumes:
- "./public:/var/www/html"
- "./my-theme-folder:/var/www/html/wp-content/themes/my-theme-folder"
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_DATABASE: wordpress
WORDPRESS_DB_USER: user
WORDPRESS_DB_PASSWORD: password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment