This commit is contained in:
30
.gitea/workflows/docker-image.deploy.yml
Normal file
30
.gitea/workflows/docker-image.deploy.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "docker/**"
|
||||
- ".gitea/**"
|
||||
- ".scripts/**"
|
||||
jobs:
|
||||
|
||||
build-docker-image:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Log in to git.limbosolutions.com docker registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.limbosolutions.com
|
||||
username: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push Docker images
|
||||
id: push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ${{gitea.workspace}}/docker
|
||||
push: true
|
||||
tags: git.limbosolutions.com/kb/duplicati:mysql-latest
|
||||
28
README.md
28
README.md
@@ -1,5 +1,19 @@
|
||||
# Duplicati
|
||||
|
||||
- [Docker](#docker)
|
||||
- [Duplicati/mySql Client - image](#duplicatimysql-client---image)
|
||||
- [Scripts](#scripts)
|
||||
- [Backup mySql Database](#backup-mysql-database)
|
||||
- [Influxdb Reporting](#influxdb-reporting)
|
||||
- [Docker log](#docker-log)
|
||||
- [Environment Variables](#environment-variables)
|
||||
- [Exit Codes](#exit-codes)
|
||||
- [cli](#cli)
|
||||
- [Send Mail](#send-mail)
|
||||
- [Settings](#settings)
|
||||
- [Send Email](#send-email)
|
||||
- [nginx](#nginx)
|
||||
|
||||
## Docker
|
||||
|
||||
### Duplicati/mySql Client - image
|
||||
@@ -8,16 +22,14 @@ Image contains all scripts
|
||||
|
||||
[+ Information](docker/mysqlclient/README.md)
|
||||
|
||||
|
||||
## Scripts
|
||||
|
||||
_Source: https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Modules/Builtin/run-script-example.sh_
|
||||
|
||||
### Backup mySql Database
|
||||
|
||||
|
||||
Using option run-script-before-required on duplicati job set value to [script](scripts/duplicati-mysql-backup).
|
||||
And job will create a database dump configured using environment variables.
|
||||
And job will create a database dump configured using environment variables.
|
||||
Example:
|
||||
--run-script-after=/duplicati-mysql-backup
|
||||
|
||||
@@ -49,16 +61,13 @@ Add [script](scripts/duplicati-influxdb-notify) to default settings.
|
||||
Example:
|
||||
--run-script-after=duplicati-influxdb-notify
|
||||
|
||||
|
||||
### Docker log
|
||||
|
||||
`
|
||||
|
||||
Add [script](docker/scripts/dockerlog) to default settings.
|
||||
Example:
|
||||
--run-script-after=dockerlog
|
||||
|
||||
|
||||
|
||||
### Environment Variables
|
||||
|
||||
Source: https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Modules/Builtin/run-script-example.sh_
|
||||
@@ -89,7 +98,6 @@ Source: https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Mod
|
||||
|
||||
### Exit Codes
|
||||
|
||||
|
||||
The following exit codes are supported:
|
||||
|
||||
- 0: OK, run operation
|
||||
@@ -100,7 +108,6 @@ The following exit codes are supported:
|
||||
- 5: Error don't run operation
|
||||
- other: Error don't run operation
|
||||
|
||||
|
||||
## cli
|
||||
|
||||
## Send Mail
|
||||
@@ -110,7 +117,6 @@ The following exit codes are supported:
|
||||
duplicati-cli send-mail --send-mail-password="pass" --send-mail-to="target@mail.lan" --send-mail-username="suer@mail.lan" --send-mail-url="smtp://serveraddress:25"
|
||||
```
|
||||
|
||||
|
||||
## Settings
|
||||
|
||||
### Send Email
|
||||
@@ -131,7 +137,7 @@ duplicati-cli send-mail --send-mail-password="pass" --send-mail-to="target@mail.
|
||||
|
||||
## nginx
|
||||
|
||||
Example running on _duplicati sub folder
|
||||
Example running on _duplicati sub folder
|
||||
|
||||
```bash
|
||||
location /_duplicati/ {
|
||||
|
||||
@@ -1,30 +1,8 @@
|
||||
# Duplicati / mySql Client
|
||||
|
||||
```bash
|
||||
|
||||
#Executed on repository root folder
|
||||
docker build -t duplicati-mysqlclient:latest -f docker/mysqlclient/Dockerfile .
|
||||
|
||||
```
|
||||
|
||||
```bash
|
||||
|
||||
#Executed on repository root folder
|
||||
sudo docker build -t duplicati-mysqlclient:latest -f docker/mysqlclient/Dockerfile --output type=tar,dest=build/duplicati-mysqlclient.tar .
|
||||
|
||||
```
|
||||
|
||||
## Portainer
|
||||
|
||||
Images -> Build a new Image -> URL
|
||||
|
||||
**Name:** duplicati-mysqlclient:latest
|
||||
|
||||
**URL:** https://git.limbosolutions.com/kb/duplicati.git
|
||||
|
||||
**Dockerfile path:** docker/mysqlclient/Dockerfile
|
||||
|
||||
|
||||
- [Docker Compose](#docker-compose)
|
||||
- [Development](#development)
|
||||
- [Docker Build](#docker-build)
|
||||
|
||||
## Docker Compose
|
||||
|
||||
@@ -32,7 +10,7 @@ Images -> Build a new Image -> URL
|
||||
version: "3"
|
||||
services:
|
||||
duplicati:
|
||||
image: duplicati-mysqlclient
|
||||
image: git.limbosolutions.com/kb/duplicati:mysql-latest
|
||||
environment:
|
||||
- MYSQL_HOST=${MYSQL_HOST}
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||
@@ -54,19 +32,12 @@ volumes:
|
||||
db-dumps:
|
||||
```
|
||||
|
||||
### Transfer To another system
|
||||
1. Copy docker compose and execute on another system
|
||||
2. Check volumes and service started succesfully
|
||||
3. Stop all compose services
|
||||
4. Change volume on duplicati service to user a temporary volume example (duclicati_tmpdata)
|
||||
5. Check if all volumes are writable on duplication service
|
||||
6. Start only the duplicati service (with temporary volume) on target system
|
||||
7. On source system Stop app services on docker compose except duplicati
|
||||
8. Execute a full backup ou source system
|
||||
9. On target system execute a manual restore to original destination
|
||||
10. Stop duplicati
|
||||
11. Change duplicati to use original volume
|
||||
12. And change volumes on duplicati to RO
|
||||
13. Start all services
|
||||
14. Check everything ok
|
||||
## Development
|
||||
|
||||
### Docker Build
|
||||
|
||||
```bash
|
||||
|
||||
#Executed on repository root folder
|
||||
docker build -t duplicati-mysqlclient:latest -f docker/mysqlclient/Dockerfile .
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user