add: backups
This commit is contained in:
parent
f6c7158f09
commit
e807ba6347
6 changed files with 73 additions and 0 deletions
39
custom/backups/Dockerfile
Executable file
39
custom/backups/Dockerfile
Executable file
|
@ -0,0 +1,39 @@
|
|||
FROM alpine:latest
|
||||
|
||||
MAINTAINER Didier <dev@faulty.nl>
|
||||
LABEL Description="Faulty's (totally original) backup app"
|
||||
|
||||
# Add a non root user
|
||||
RUN adduser -s /bin/sh -D backups
|
||||
RUN addgroup containers
|
||||
RUN addgroup backups containers
|
||||
|
||||
# python
|
||||
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
|
||||
|
||||
# directories
|
||||
RUN mkdir /app
|
||||
RUN mkdir /config
|
||||
RUN mkdir /data
|
||||
RUN mkdir /remote
|
||||
RUN mkdir /local
|
||||
|
||||
# chown
|
||||
RUN chown -R backups:containers /app
|
||||
RUN chown -R backups:containers /config
|
||||
RUN chown -R backups:containers /data
|
||||
RUN chown -R backups:containers /local
|
||||
RUN chown -R backups:containers /remote
|
||||
|
||||
# copy files
|
||||
COPY ./repo/src/main.py /app/main.py
|
||||
COPY ./repo/src/lib /app/lib
|
||||
COPY ./repo/src/sample_configs /app/default_config
|
||||
|
||||
# copy config
|
||||
COPY ./config /config
|
||||
|
||||
USER backups
|
||||
WORKDIR /app
|
||||
ENV PYTHONUNBUFFERED=true
|
||||
ENTRYPOINT python3 main.py
|
4
custom/backups/config/global.json
Executable file
4
custom/backups/config/global.json
Executable file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"remote_dir": "/remote",
|
||||
"tasks_dir": "/config/tasks"
|
||||
}
|
11
custom/backups/config/tasks/server.json
Normal file
11
custom/backups/config/tasks/server.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "serverBuildTools",
|
||||
"interval": 604800,
|
||||
"base": "/data",
|
||||
"paths": [
|
||||
"docker"
|
||||
],
|
||||
"local_days_of_retention": 1,
|
||||
"remote_days_of_retention": 30,
|
||||
"backup_dir": "/local"
|
||||
}
|
16
custom/backups/config/tasks/services.json
Executable file
16
custom/backups/config/tasks/services.json
Executable file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "commonServicesData",
|
||||
"interval": 172800,
|
||||
"base": "/data/services",
|
||||
"paths": [
|
||||
"cryptpad",
|
||||
"gitlab",
|
||||
"dendrite",
|
||||
"smpxmc",
|
||||
"kasmc",
|
||||
"smpxterraria"
|
||||
],
|
||||
"local_days_of_retention": 2,
|
||||
"remote_days_of_retention": 30,
|
||||
"backup_dir": "/local"
|
||||
}
|
1
custom/backups/repo
Submodule
1
custom/backups/repo
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 39b8411aa6e2f568a4c86bbc619ab5dc58d784a4
|
Reference in a new issue