Skip to content

Instantly share code, notes, and snippets.

@mrizwan47
Created December 31, 2020 14:30
Show Gist options
  • Save mrizwan47/4e3ba6f8f144384d46fcef104dbf6c5e to your computer and use it in GitHub Desktop.
Save mrizwan47/4e3ba6f8f144384d46fcef104dbf6c5e to your computer and use it in GitHub Desktop.
Docker for WordPress
version: '3'
services:
# Database
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
- /Volumes/DATA/Development/rizwan_47/sample-project/misc/database:/mysql-db/ # Change path before semicolon here
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
networks:
- wpsite
# phpmyadmin
phpmyadmin:
depends_on:
- db
image: phpmyadmin/phpmyadmin
ports:
- '8080:80'
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: password
networks:
- wpsite
# Wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- '8000:80'
volumes:
- './:/var/www/html'
- '/Volumes/DATA/Development/rizwan_47/sample-project/sample-wordpress-project:/var/www/html/wp-content/themes/sample-wordpress-project' # Change path before semicolon here
- '/Volumes/DATA/Development/rizwan_47/sample-project/misc/understrap:/var/www/html/wp-content/themes/understrap' # Change path before semicolon here
- '/Volumes/DATA/Development/rizwan_47/sample-project/misc/uploads:/var/www/html/wp-content/uploads' # Change path before semicolon here
- '/Volumes/DATA/Development/rizwan_47/sample-project/misc/mu-plugins:/var/www/html/wp-content/mu-plugins' # Change path before semicolon here
- '/Volumes/DATA/Development/rizwan_47/sample-project/misc/plugins:/var/www/html/wp-content/plugins' # Change path before semicolon here
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
networks:
- wpsite
networks:
wpsite:
volumes:
db_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment