docker-wordpress-universal/README.md

55 lines
1.0 KiB
Markdown
Raw Normal View History

2022-12-09 03:40:02 +01:00
# Simple custom template for a clean Wordpress installation.
2021-03-17 02:18:47 +01:00
2022-12-09 03:40:02 +01:00
## Pre
$ mkdir data db
$ cp env.sample .env
$ vim .env
Customize parameters
## Build
2021-03-17 00:10:54 +01:00
$ docker-compose build
2022-12-09 03:40:02 +01:00
## Run
2021-03-17 00:10:54 +01:00
$ docker-compose up -d
2022-12-09 03:40:02 +01:00
Access:
$ w3m http://localhost:<nginx_port>
## Config
2021-03-17 00:10:54 +01:00
2022-12-09 03:40:02 +01:00
Database credentials may edit on _.env_ file.
2021-03-17 02:18:47 +01:00
2022-12-09 03:40:02 +01:00
## Auto update Wordpress
2021-03-17 02:18:47 +01:00
User crontab on your hoster server.
Use this script as template:
```
#!/bin/bash
echo "Update Wordrpress"
2022-12-09 03:40:02 +01:00
docker-compose exec wordpress wp theme update --all --path="/app/wordpress/"
docker-compose exec wordpress wp plugin update --all --path="/app/wordpress/"
docker-compose exec wordpress wp core update --path="/app/wordpress/"
2021-03-17 02:18:47 +01:00
```
2022-12-09 03:40:02 +01:00
## Backups
2021-03-17 02:18:47 +01:00
2022-12-09 03:40:02 +01:00
docker-compose exec db mysqldump --database <MYSQL_DATABASE> > <custom_path>/<dump>.sql
2021-03-17 02:18:47 +01:00
2022-12-09 03:40:02 +01:00
## Restore
2021-03-17 02:18:47 +01:00
Database restore, like this examples:
2022-12-09 03:40:02 +01:00
$ cat <dump>.sql | docker-compose exec db mysql -u <db_user> -p<db_pass> <database>
2021-03-17 00:10:54 +01:00
2021-03-17 02:18:47 +01:00
Data restore, bulk to volume directory, like:
2021-03-17 00:10:54 +01:00
2021-03-17 02:18:47 +01:00
$ rsync -avz <backup_wordpress_dir> /var/lib/docker/volumes/<docker_wordpress_volume>/_data/wordpress/