Documentation

This commit is contained in:
Siroco 2021-03-17 02:18:47 +01:00
parent ac9731c481
commit a623668c17
2 changed files with 35 additions and 7 deletions

View File

@ -3,11 +3,10 @@ FROM debian:buster-slim as build
RUN apt-get update && \
apt-get -qy install \
php-fpm php-mysql php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip \
sudo wget curl ca-certificates&&\
sudo wget curl ca-certificates less &&\
apt-get clean
RUN useradd wordpress
RUN useradd wordpress -d /app/
COPY wordpress.conf /etc/php/7.3/fpm/pool.d/www.conf
RUN mkdir /run/php/
#RUN mkdir logs
@ -22,16 +21,16 @@ RUN rm latest.tar.gz
#ADD wordpress_files/themes/ /app/wordpress/wp-content/themes/
#ADD wordpress_files/plugins/ /app/wordpress/wp-content/plugins/
#ADD wordpress_files/sunrise.php /app/wordpress/wp-content/sunrise.php
RUN chown -R wordpress:wordpress /app/wordpress
RUN chown -R wordpress:wordpress /app/
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
RUN chmod +x wp-cli.phar
RUN mv wp-cli.phar wp
## ESTO EN UN CRON DAILY
#RUN sudo -u wordpress /app/wp theme update --all --path="/app/wordpress/"
#RUN sudo -u wordpress -i -- /app/wp theme update --all --path="/app/wordpress/"
#RUN ./wp plugin update --all --path="/app/wordpress/"
#RUN ./wp core update --all --path="/app/wordpress/"
#RUN ./wp core update --path="/app/wordpress/"
#USER root

View File

@ -1,3 +1,5 @@
Simple custom template for a clean Wordpress installation.
# Install
$ docker-compose build
@ -8,6 +10,33 @@
# Config
Database ENVIRONMENT on docker-compose.yml
Database credentials may edit on ENVIRONMENT on docker-compose.yml
# Auto update Wordpress
User crontab on your hoster server.
Use this script as template:
```
#!/bin/bash
echo "Update Wordrpress"
docker exec -it docker-wordpress-ahum_wordpress_1 sudo -u wordpress -i -- /app/wp theme update --all --path="/app/wordpress/"
docker exec -it docker-wordpress-ahum_wordpress_1 sudo -u wordpress -i -- /app/wp plugin update --all --path="/app/wordpress/"
docker exec -it docker-wordpress-ahum_wordpress_1 sudo -u wordpress -i -- /app/wp core update --path="/app/wordpress/"
```
# Backups
....
# Restore
Database restore, like this examples:
$ cat <dump>.sql | docker exec -i <docker_database_name> mysql -u <db_user> -p<db_pass>
Data restore, bulk to volume directory, like:
$ rsync -avz <backup_wordpress_dir> /var/lib/docker/volumes/<docker_wordpress_volume>/_data/wordpress/