Skip to content

Instantly share code, notes, and snippets.

@maxjf1
Last active May 21, 2020 20:54
Show Gist options
  • Save maxjf1/e5f57b1fbd4838fce78fedb0c842cd47 to your computer and use it in GitHub Desktop.
Save maxjf1/e5f57b1fbd4838fce78fedb0c842cd47 to your computer and use it in GitHub Desktop.
Docker Compose for WordPress Development
version: "3.1"
services:
wordpress:
image: wordpress
restart: unless-stopped
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
- ./wordpress-theme:/var/www/html/wp-content/wordpress-theme
- ./wp-content:/var/www/html/wp-content
depends_on:
- db
db:
image: mysql:5.7
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
volumes:
- ./database:/var/lib/mysql
# - ./backup.sql:docker-entrypoint-initdb.d/backup.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment