Last active
December 8, 2017 21:52
-
-
Save iansinnott/241e4d23904ed1fd175c8ceb963b32f1 to your computer and use it in GitHub Desktop.
quick-wordpress-docker-compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
wordpress: | |
image: wordpress:4.9 | |
ports: | |
- "127.0.0.1:8080:80" | |
volumes: | |
- ./wp-content/themes:/var/www/html/wp-content/themes | |
- ./wp-content/plugins:/var/www/html/wp-content/plugins | |
environment: | |
WORDPRESS_DB_HOST: db:3306 | |
WORDPRESS_DB_NAME: wordpress | |
WORDPRESS_DB_PASSWORD: wordpress | |
db: | |
image: mysql:5.7 | |
ports: | |
- "127.0.0.1:3306:3306" # Expose so we can connect locally | |
volumes: | |
- db_data:/var/lib/mysql | |
environment: | |
MYSQL_ROOT_PASSWORD: wordpress | |
MYSQL_DATABASE: wordpress | |
MYSQL_USER: wordpress | |
MYSQL_PASSWORD: wordpress | |
volumes: | |
db_data: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated for docker-compose yaml v3.
wp-content is volumed in for local development of themes / plugins.
MySQL is also exposed locally since you probably want to be able to access it in dev.