This commit is contained in:
7
.devcontainer/Dockerfile
Normal file
7
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
FROM duplicati/duplicati
|
||||||
|
|
||||||
|
RUN apt update && \
|
||||||
|
apt install -y default-mysql-client && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
EXPOSE 8200
|
||||||
38
.devcontainer/devcontainer.json
Normal file
38
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
|
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
|
||||||
|
{
|
||||||
|
"name": "duplicati_dev-container",
|
||||||
|
"build": {
|
||||||
|
// Path is relative to the devcontainer.json file.
|
||||||
|
"dockerfile": "Dockerfile"
|
||||||
|
},
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainers/features/git:1": {
|
||||||
|
"ppa": true,
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
"ghcr.io/prulloac/devcontainer-features/gitlint:1": {}
|
||||||
|
},
|
||||||
|
"containerEnv": {}
|
||||||
|
|
||||||
|
//"features": {
|
||||||
|
// "ghcr.io/wxw-matt/devcontainer-features/command_runner:0": {},
|
||||||
|
// "ghcr.io/wxw-matt/devcontainer-features/script_runner:0": {},
|
||||||
|
// "ghcr.io/devcontainers-extra/features/act:1": {}
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||||
|
// "features": {},
|
||||||
|
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
// "forwardPorts": [],
|
||||||
|
|
||||||
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
|
// "postCreateCommand": "uname -a",
|
||||||
|
|
||||||
|
// Configure tool-specific properties.
|
||||||
|
// "customizations": {},
|
||||||
|
|
||||||
|
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||||
|
// "remoteUser": "root"
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- "docker/mysqlclient/**"
|
- "docker/**"
|
||||||
- ".gitea/**"
|
- ".gitea/**"
|
||||||
- "scripts/**"
|
- "scripts/**"
|
||||||
jobs:
|
jobs:
|
||||||
@@ -26,6 +26,6 @@ jobs:
|
|||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: ${{gitea.workspace}}
|
context: ${{gitea.workspace}}
|
||||||
file: ${{gitea.workspace}}/docker/mysqlclient/Dockerfile
|
file: ${{gitea.workspace}}/docker/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: git.limbosolutions.com/kb/duplicati:mysql-latest
|
tags: git.limbosolutions.com/kb/duplicati:latest
|
||||||
|
|||||||
12
.github/dependabot.yml
vendored
Normal file
12
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for more information:
|
||||||
|
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||||
|
# https://containers.dev/guide/dependabot
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "devcontainers"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
20
.vscode/settings.json
vendored
20
.vscode/settings.json
vendored
@@ -1,3 +1,19 @@
|
|||||||
{
|
{
|
||||||
"docker.commands.build": "${containerCommand} build --pull --rm -f \"${dockerfile}\" -t ${tag} . --progress=plain"
|
"docker.commands.composeUpSubset": [
|
||||||
}
|
|
||||||
|
{
|
||||||
|
"label": "Compose Up",
|
||||||
|
"template": "${composeCommand} ${profileList} ${configurationFile} up ${detached} ${build} ${serviceList}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"docker.commands.composeUp": [
|
||||||
|
|
||||||
|
{
|
||||||
|
"label": "Compose Up",
|
||||||
|
"template": "${composeCommand} ${configurationFile} up ${detached} ${build}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"docker.contexts.showInStatusBar": true
|
||||||
|
} // {
|
||||||
|
// "docker.commands.build": "${containerCommand} build --pull --rm -f \"${dockerfile}\" -t ${tag} . --progress=plain"
|
||||||
|
// }
|
||||||
19
README.md
19
README.md
@@ -3,7 +3,7 @@
|
|||||||
- [Docker](#docker)
|
- [Docker](#docker)
|
||||||
- [Duplicati/mySql Client - image](#duplicatimysql-client---image)
|
- [Duplicati/mySql Client - image](#duplicatimysql-client---image)
|
||||||
- [Scripts](#scripts)
|
- [Scripts](#scripts)
|
||||||
- [Backup mySql Database](#backup-mysql-database)
|
- [mysql - dump backup](#mysql---dump-backup)
|
||||||
- [Influxdb Reporting](#influxdb-reporting)
|
- [Influxdb Reporting](#influxdb-reporting)
|
||||||
- [Docker log](#docker-log)
|
- [Docker log](#docker-log)
|
||||||
- [Environment Variables](#environment-variables)
|
- [Environment Variables](#environment-variables)
|
||||||
@@ -20,23 +20,17 @@
|
|||||||
|
|
||||||
Image contains all scripts
|
Image contains all scripts
|
||||||
|
|
||||||
[+ Information](docker/mysqlclient/README.md)
|
[+ Information](docker/README.md)
|
||||||
|
|
||||||
## Scripts
|
## Scripts
|
||||||
|
|
||||||
_Source: https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Modules/Builtin/run-script-example.sh_
|
Source: <https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Modules/Builtin/run-script-example.sh>
|
||||||
|
|
||||||
### Backup mySql Database
|
### mysql - dump backup
|
||||||
|
|
||||||
Using option run-script-before-required on duplicati job set value to [script](scripts/duplicati-mysql-backup).
|
Duplicati options set `run-script-before-required` to [duplicati-mysql-backup](scripts/duplicati-mysql-backup).
|
||||||
And job will create a database dump configured using environment variables.
|
|
||||||
Example:
|
|
||||||
--run-script-after=/duplicati-mysql-backup
|
|
||||||
|
|
||||||
[script](scripts/duplicati-mysql-backup)
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
#/etc/default/duplicati-mysql
|
|
||||||
MYSQL_HOST="mysqlserver"
|
MYSQL_HOST="mysqlserver"
|
||||||
MYSQL_USER="msqluser"
|
MYSQL_USER="msqluser"
|
||||||
MYSQL_PASSWORD="msqlpassord"
|
MYSQL_PASSWORD="msqlpassord"
|
||||||
@@ -63,14 +57,13 @@ Example:
|
|||||||
|
|
||||||
### Docker log
|
### Docker log
|
||||||
|
|
||||||
|
|
||||||
Add [script](docker/scripts/dockerlog) to default settings.
|
Add [script](docker/scripts/dockerlog) to default settings.
|
||||||
Example:
|
Example:
|
||||||
--run-script-after=dockerlog
|
--run-script-after=dockerlog
|
||||||
|
|
||||||
### Environment Variables
|
### Environment Variables
|
||||||
|
|
||||||
Source: https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Modules/Builtin/run-script-example.sh_
|
Source: <https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Modules/Builtin/run-script-example.sh>_
|
||||||
|
|
||||||
- DUPLICATI__EVENTNAME
|
- DUPLICATI__EVENTNAME
|
||||||
|
|
||||||
|
|||||||
17
docker/Dockerfile
Normal file
17
docker/Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
FROM duplicati/duplicati
|
||||||
|
RUN apt update && \
|
||||||
|
apt install -y default-mysql-client && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
#repo root scripts
|
||||||
|
COPY /docker/scripts /usr/local/bin
|
||||||
|
|
||||||
|
#docker scripts
|
||||||
|
COPY ./scripts /usr/local/bin
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
chmod +x /usr/local/bin/duplicati-influxdb-notify; \
|
||||||
|
chmod +x /usr/local/bin/duplicati-mysql-backup; \
|
||||||
|
chmod +x /usr/local/bin/dockerlog
|
||||||
|
|
||||||
|
EXPOSE 8200
|
||||||
@@ -32,12 +32,3 @@ volumes:
|
|||||||
db-dumps:
|
db-dumps:
|
||||||
```
|
```
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
### Docker Build
|
|
||||||
|
|
||||||
```bash
|
|
||||||
|
|
||||||
#Executed on repository root folder
|
|
||||||
docker build -t duplicati-mysqlclient:latest -f docker/mysqlclient/Dockerfile .
|
|
||||||
```
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
|
|
||||||
FROM duplicati/duplicati
|
|
||||||
RUN apt update && apt install -y default-mysql-client && rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
COPY ../../ /app
|
|
||||||
RUN ls ./app
|
|
||||||
|
|
||||||
COPY ../../docker/scripts /usr/local/bin
|
|
||||||
COPY ./scripts /usr/local/bin
|
|
||||||
|
|
||||||
RUN chmod +x /usr/local/bin/duplicati-influxdb-notify
|
|
||||||
RUN chmod +x /usr/local/bin/duplicati-mysql-backup
|
|
||||||
RUN chmod +x /usr/local/bin/dockerlog
|
|
||||||
|
|
||||||
EXPOSE 8200
|
|
||||||
Reference in New Issue
Block a user