initial commit

This commit is contained in:
2026-03-13 09:13:51 +00:00
commit a772f59ac3
3 changed files with 38 additions and 0 deletions

12
backup.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
set -e
NOW=$(date +"%Y%m%d-%H%M")
OUT="/backup/output/gitea-$NOW.tar.gz"
echo "== Gitea SQLite Backup $NOW =="
tar -czvf "$OUT" /data/gitea
echo "Backup saved as $OUT"

1
crontab Normal file
View File

@@ -0,0 +1 @@
0 1 * * * /backup/backup.sh >> /backup/cron.log 2>&1

25
docker-compose.yaml Normal file
View File

@@ -0,0 +1,25 @@
version: "3"
services:
server:
image: docker.gitea.com/gitea:1.25.4
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=1000
restart: always
volumes:
- ./data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "222:22"
backup:
image: alpine:latest
container_name: gitea-backup
volumes:
- ./data:/data:ro
- ./backup:/backup
- ./backup/crontab:/etc/crontabs/root:ro
entrypoint: /bin/sh -c "crond -f -l 2"