Coder Social home page Coder Social logo

anklav24 / wordpress-docker Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 65 KB

If you need your own WordPress server with HTTPS and Backups.

Home Page: https://4ДУШИ.РФ

Shell 100.00%
docker-compose wordpress https gdrive-sync backup traefik-v2 redis

wordpress-docker's Introduction

WordPress, MySQL, Redis, phpMyAdmin, Traefik (TLS, HTTPS), Docker, Uploading to Google Drive

Overview

If you need your own WordPress server with HTTPS and Backups.

Requirements

  • Oracle VPS Free Tier ARM (VM.Standard.A1.Flex) I did on 4 CPU Ampere 24 RAM.
  • Ubuntu 20.04 ARM

Version

  • docker-compose version 2.4
  • wordpress:php8.0
  • redis 6.0.15-alpine
  • Zabbix agent 5.0.16
  • Postgres 12
  • Traefik 2.5.3
  • Portainer 2.9.3-alpine
  • phpmyadmin 5.1.1
  • pgadmin 4.6.2
  • mysql-server:8.0 (Oracle)

Tested

  • 2021-12-21

Installation

Clone the repository

cd ~ &&
git clone https://github.com/anklav24/wordpress-docker &&
cd wordpress-docker

Select a develop branch (Optional)

git checkout develop

Rename deploy_configs_example, .env.example

  • deploy_configs_example -> deploy_configs
  • .env.example -> .env

Check deploy_configs, *-docker-compose.yaml, .env

Replace domains, envs, emails, logins, passwords and tls.certresolver on yours! Don't use examples in production!

Install Docker, Docker-compose and other stuff.

chmod +x install.sh && ./install.sh

Install gdrive as root user

# Example
gdrive list --absolute --query "mimeType = 'application/vnd.google-apps.folder' and name contains 'backup'" --max 1000
  • Change in 4soulsband_wordpress_backup.sh gdrive_folder_id variable to your Id

Setup Yandex Drive Aouth token

  • In .env add your YANDEX_TOKEN
  • Go to web yandex disk and create folder /backups/sites_backup/ or change the path in the backup scripts

Setup logrotate for traefik

  • Setup logrotate check config in deploy_configs/logrotate.d/traefik
  • Or turn off logs

After install go to check your wordpress domain

Run compose files

cd ~/wordpress-docker
docker-compose -f 1-docker-compose.yaml up -d; 
docker-compose -f 2-docker-compose.yaml up -d

UI Links

References

Troubleshooting:

If a WordPress site has the "gateway timeout" error, you need to set default network for traefik:

- traefik.docker.network=traefik_proxy_net

Useful commands

Redis

docker exec -ti redis redis-cli -p 6380 monitor

docker exec -ti redis redis-cli -p 6380
127.0.0.1:6379> KEYS *

Systemd service

Set up backup automation:

sudo cp systemd_services/* /etc/systemd/system/  # Copy services and timers files.
sudo systemctl start 4soulsband_wordpress_montly_backup.service  # Check the service works properly (Example)
sudo systemctl enable 4soulsband_wordpress_montly_backup.timer  # Enable a timer (Example)
sudo systemctl daemon-reload  # Reload systemd after service changing.
clear; sudo systemctl status *4sou*timer  # Check backup timers
sudo systemctl list-timers  # Check all timers

sudo systemctl start 4soulsband_wordpress_daily_backup.service  # Start the backup manually.
sudo systemctl start 4soulsband_wordpress_weekly_backup.service  # Start the backup manually.
sudo systemctl start 4soulsband_wordpress_yearly_backup.service  # Start the backup manually. With Google Drive Sync

journalctl -u 4soulsband_wordpress_daily_backup.timer  # Check logs
journalctl -u 4soulsband_wordpress_daily_backup.service  # Check logs

Backup and restore

Backup

# Example
./4soulsband_wordpress_backup.sh daily 7 YOUR_DATABASE_NAME YOUR_DATABASE_USER YOUR_DATABASE_PASSWORD true
# Need args: task_name (daily, monthly, yearly), days_to_keep (7, 186, 1825), mysql_db_name, mysql_user, mysql_password, [debug (true)]

Restore

# Before you need change timestamp and backup_dir_name variables in the file 
./4soulsband_wordpress_restore.sh daily YOUR_DATABASE_NAME YOUR_DATABASE_USER YOUR_DATABASE_PASSWORD true
# Need args: task_name (daily, monthly, yearly), mysql_db_name, mysql_user, mysql_password, [debug (true)]

wordpress-docker's People

Contributors

anklav24 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.