Skip to content
Snippets Groups Projects
Commit 8c918719 authored by Nezbeda Harald's avatar Nezbeda Harald
Browse files

Enhance db dump export, docs for theme and plugin development

parent 5a1d2d2a
Branches
No related tags found
No related merge requests found
......@@ -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
```
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:
......
_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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment