48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
services:
|
|
gitea:
|
|
image: gitea/gitea:latest
|
|
container_name: gitea
|
|
environment:
|
|
- USER_UID=1000
|
|
- USER_GID=1000
|
|
- GITEA__database__DB_TYPE=postgres
|
|
- GITEA__database__HOST=192.168.50.42:5432
|
|
- GITEA__database__NAME=gitea
|
|
- GITEA__database__USER=postgres
|
|
- GITEA__database__PASSWD=ratata,123
|
|
restart: unless-stopped
|
|
volumes:
|
|
- gitea_data:/data
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
- /data/backup/gitea:/tmp/backup
|
|
ports:
|
|
- "3008:3000"
|
|
- "2222:22"
|
|
|
|
gitea-backup:
|
|
image: alpine:3.21
|
|
container_name: gitea-backup
|
|
depends_on:
|
|
- gitea
|
|
restart: unless-stopped
|
|
environment:
|
|
- BACKUP_RETAIN_DAYS=7
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- /data/backup/gitea:/backup
|
|
- ./backup.sh:/usr/local/bin/backup.sh:ro
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
entrypoint: /bin/sh
|
|
command:
|
|
- -c
|
|
- |
|
|
apk add --no-cache docker-cli
|
|
echo "0 2 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1" > /etc/crontabs/root
|
|
touch /var/log/backup.log
|
|
crond -f -l 2
|
|
|
|
volumes:
|
|
gitea_data:
|