Skip to content

Instantly share code, notes, and snippets.

@ChrisLTD
Last active November 14, 2020 00:37
Show Gist options
  • Save ChrisLTD/19ffca93775072493560a567e47249a7 to your computer and use it in GitHub Desktop.
Save ChrisLTD/19ffca93775072493560a567e47249a7 to your computer and use it in GitHub Desktop.
Docker Compose for WordPress with Data Persistence
# Docker Compose for WordPress with Data Persistence
#
# Resources
# https://medium.com/@tatemz/local-wordpress-development-with-docker-3-easy-steps-a7c375366b9
# https://hub.docker.com/_/wordpress/
# https://hub.docker.com/r/_/mariadb/
# https://stackoverflow.com/a/39208187/648844
# https://github.com/nezhar/wordpress-docker-compose
#
version: "2"
services:
my-wpdb:
image: mysql:5.7
volumes:
- ./wp-data:/var/lib/mysql
ports:
- "8081:3306"
environment:
MYSQL_ROOT_PASSWORD: root
my-wp:
image: wordpress
volumes:
- ./wp-app:/var/www/html
ports:
- "8888:80"
links:
- my-wpdb:mysql
environment:
WORDPRESS_DB_PASSWORD: root
volumes:
wp-data:
@kevb10
Copy link

kevb10 commented Mar 31, 2019

why do you declare wp-data in volumes but not wp-app?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment