feat: add APK_MIRROR environment variable to backup-manager service

This commit is contained in:
2026-04-17 16:26:32 +03:30
parent 569b66a623
commit 2ebbbdf941

View File

@@ -26,6 +26,7 @@ services:
BACKUP_RETENTION_COUNT: ${BKP_RETENTION_COUNT} BACKUP_RETENTION_COUNT: ${BKP_RETENTION_COUNT}
BACKUP_RETENTION_DAYS: ${BKP_RETENTION_DAYS} BACKUP_RETENTION_DAYS: ${BKP_RETENTION_DAYS}
TIMEZONE: ${TIMEZONE} TIMEZONE: ${TIMEZONE}
APK_MIRROR: ${APK_MIRROR}
volumes: volumes:
- ./backups:/backups - ./backups:/backups
- type: volume - type: volume
@@ -50,4 +51,4 @@ services:
read_only: true read_only: true
- ./scripts/backup/manage-backups.sh:/manage-backups.sh - ./scripts/backup/manage-backups.sh:/manage-backups.sh
- ./scripts/backup/backup-manager.cron:/etc/crontabs/root - ./scripts/backup/backup-manager.cron:/etc/crontabs/root
entrypoint: ["/bin/sh", "-c", "# install bsdtar for xattr-aware archives\napk add --no-cache libarchive-tools attr >/dev/null \n# map host /backups ownership to container backup user\nHOST_UID=$$(stat -c '%u' /backups 2>/dev/null || echo 1000) && HOST_GID=$$(stat -c '%g' /backups 2>/dev/null || echo 1000) && addgroup -g \"$$HOST_GID\" backup 2>/dev/null || true && adduser -D -u \"$$HOST_UID\" -G backup backup 2>/dev/null || true && mkdir -p /var/log /backups && chown -R \"$$HOST_UID\":\"$$HOST_GID\" /var/log /backups 2>/dev/null || true && chmod +x /manage-backups.sh && chown root:root /etc/crontabs/root 2>/dev/null || true && crond -f"] entrypoint: ["/bin/sh", "-c", "# install bsdtar for xattr-aware archives\nif [ -n \"$$APK_MIRROR\" ]; then sed -i \"s|https://dl-cdn.alpinelinux.org|$$APK_MIRROR|g\" /etc/apk/repositories; fi && apk add --no-cache libarchive-tools attr >/dev/null \n# map host /backups ownership to container backup user\nHOST_UID=$$(stat -c '%u' /backups 2>/dev/null || echo 1000) && HOST_GID=$$(stat -c '%g' /backups 2>/dev/null || echo 1000) && addgroup -g \"$$HOST_GID\" backup 2>/dev/null || true && adduser -D -u \"$$HOST_UID\" -G backup backup 2>/dev/null || true && mkdir -p /var/log /backups && chown -R \"$$HOST_UID\":\"$$HOST_GID\" /var/log /backups 2>/dev/null || true && chmod +x /manage-backups.sh && chown root:root /etc/crontabs/root 2>/dev/null || true && crond -f"]