diff --git a/README.md b/README.md index 64a30445c4e8f46732e9af83fffc49cdcbadf92e..d95df1d4be74293b8dd6aff08926e13dbe5e5511 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,24 @@ define('WP_SITEURL','http://wp-app.local'); ## Creating database dumps ``` -sudo docker-compose exec db sh -c 'exec mysqldump "$MYSQL_DATABASE" -uroot -p"$MYSQL_ROOT_PASSWORD"' > wp-data/data.sql +sudo ./export.sh ``` --- + +## Developing a Theme + +Configure the volume to load the theme in the container in the docker-compose.yml + +``` +volumes: + - ./theme-name/trunk/:/var/www/html/wp-content/themes/theme-name +``` + +## Developing a Plugin + +Configure the volume to load the plugin in the container in the docker-compose.yml + +``` +volumes: + - ./plugin-name/trunk/:/var/www/html/wp-content/plugins/plugin-name +``` diff --git a/docker-compose.yml b/docker-compose.yml index 6abc931947cd0e7c877251e6adc7a60663d272b6..0464079492dd19d9788a252d664d5c7fbdddd010 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,13 @@ version: '2' services: wordpress: - image: wordpress:latest + image: wordpress:latest # https://hub.docker.com/_/wordpress/ ports: - 127.0.10.10:80:80 # change ip if required volumes: - - ./wp-app:/var/www/html + - ./wp-app:/var/www/html # Full wordpress project + #- ./plugin-name/trunk/:/var/www/html/wp-content/plugins/plugin-name # Plugin development + #- ./theme-name/trunk/:/var/www/html/wp-content/themes/theme-name # Theme development environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_NAME: wordpress @@ -16,7 +18,7 @@ services: networks: - wordpress-network db: - image: mysql:latest # or mariadb + image: mysql:latest # https://hub.docker.com/_/mysql/ - or mariadb https://hub.docker.com/_/mariadb ports: - 127.0.10.10:3306:3306 # change ip if required volumes: diff --git a/export.sh b/export.sh new file mode 100755 index 0000000000000000000000000000000000000000..7d2ab97abaf3ddecfaac0c224da61fd99b0f3e1a --- /dev/null +++ b/export.sh @@ -0,0 +1,4 @@ +_now=$(date +"%m_%d_%Y") +_file="wp-data/data_$_now.sql" +docker-compose exec db sh -c 'exec mysqldump "$MYSQL_DATABASE" -uroot -p"$MYSQL_ROOT_PASSWORD"' > $_file +sed -i 1,1d $_file # Removes the password warning from the file \ No newline at end of file