Add backups for gitea
This commit is contained in:
@ -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:
|
||||
|
13
files/gitea/gitea-dump.sh.j2
Normal file
13
files/gitea/gitea-dump.sh.j2
Normal 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
|
Reference in New Issue
Block a user