Auto backups.

This commit is contained in:
Sunoru 2023-07-16 22:19:20 +01:00
parent 52b3367a58
commit 1ee7800a4d
No known key found for this signature in database
GPG key ID: 4F279F385559D05D
6 changed files with 40 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,7 +1,6 @@
.env*
/postgres
/redis
/mastodon
/backups
/nginx/*
!/nginx/conf.d

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "mastodon"]
path = mastodon
url = https://github.com/mastodon/mastodon.git

View file

@ -3,7 +3,7 @@ FROM tootsuite/mastodon:v4.1.4
USER root
RUN mkdir -p /var/cache/apt/archives/partial && apt autoclean
RUN apt update && apt-get install -y sudo vim htop patch && rm -rf /var/lib/apt/lists/*
RUN apt update && apt-get install -y sudo vim htop && rm -rf /var/lib/apt/lists/*
# Restore working dir
WORKDIR /opt/mastodon

View file

@ -103,6 +103,18 @@ services:
- ./nginx/cache:/var/cache/nginx
- ./nginx/conf.d:/etc/nginx/conf.d
duplicity:
container_name: mastodon-duplicity
hostname: mastodon-duplicity
restart: always
image: ghcr.io/tecnativa/docker-duplicity-postgres-s3:v3.1.1
env_file: .env.duplicity
networks:
- internal_network
- external_network
volumes:
- ./redis:/mnt/redis:ro
networks:
external_network:
internal_network:

23
env.duplicity.sample Normal file
View file

@ -0,0 +1,23 @@
PGHOST=db
PGUSER=mastodon
PGPASSWORD=
DBS_TO_INCLUDE="^mastodon_production$"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
DST=boto3+s3://<bucket_name>/backups/mastodon
PASSPHRASE=
OPTIONS=--s3-use-ia
JOB_150_WHAT=cp /mnt/redis/dump.rdb /mnt/backup/src/dump.rdb
JOB_150_WHEN=daily
JOB_500_WHEN=never
EMAIL_FROM=
EMAIL_TO=
SMTP_HOST=
SMTP_PORT=
SMTP_USER=
SMTP_PASS=
SMTP_REPORT_SUCCESS=0

1
mastodon Submodule

@ -0,0 +1 @@
Subproject commit 3f5af768c8f1401f77d14ad5b6aeccdb7e02a9f0