This commit is contained in:
2023-06-10 07:38:17 +01:00
parent 1b8e7fde9b
commit 734a6b99e0
5 changed files with 77 additions and 61 deletions

View File

@@ -1,4 +1,4 @@
#check ../README.md for more information
FROM duplicati/duplicati
RUN apt update && apt install -y default-mysql-client && rm -rf /var/lib/apt/lists/*

View File

@@ -1,28 +1,20 @@
# Duplicati / mySql Client
Using option run-script-before-required on duplicati job set value to /duplicati-mysqlclient/scripts/backupdb.sh.
And job will create a database dump configured using docker environment variables
## Build Image
### docker
```bash
#Executed on repository root folder
docker build -t duplicati-mysqlclient:latest -f docker/mysqlclient/Dockerfile .
```
### tar
```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
## Portainer
Images -> Build a new Image -> URL
@@ -33,9 +25,8 @@ Images -> Build a new Image -> URL
**Dockerfile path:** docker/mysqlclient/Dockerfile
## Run Container
### Docker Compose
## Docker Compose
```yaml
version: "3"
@@ -48,6 +39,10 @@ services:
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- DESTINATION=/db-dumps
- INFLUXDB_SERVER=${INFLUXDB_SERVER}
- INFLUXDB_BUCKET=${INFLUXDB_BUCKET}
- INFLUXDB_ORG=${INFLUXDB_ORG}
- INFLUXDB_TOKEN=:{INFLUXDB_TOKEN}
volumes:
- duplicati-data:/data
- db-dumps:/db-dumps
@@ -57,7 +52,8 @@ services:
volumes:
duplicati-data:
db-dumps:
````
```
### Transfer To another system
1. Copy docker compose and execute on another system
2. Check volumes and service started succesfully
@@ -74,4 +70,3 @@ volumes:
13. Start all services
14. Check everything ok
### Environment Variables