1
0

Add backups for gitea

This commit is contained in:
2025-05-03 16:56:22 +03:00
parent 9a3e646d8a
commit 155d065dd0
7 changed files with 195 additions and 108 deletions

View File

@ -1,6 +1,6 @@
services:
server:
gitea_web_app:
image: gitea/gitea:1.22.6
restart: unless-stopped
container_name: gitea_web_app
@ -10,6 +10,7 @@ services:
- "GITEA__server__SSH_PORT=2222"
volumes:
- ./data:/data
- ./backups:/backups
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:

View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eu
set -o pipefail
echo "Gitea: backup data with gitea dump"
(cd {{ base_dir }} && docker compose exec -u "{{ user_create_result.uid }}:{{ user_create_result.group }}" -w /backups gitea_web_app gitea dump -c /data/gitea/conf/app.ini)
echo "Gitea: remove old backups"
keep-files.py {{ backups_dir }} --keep 2