Add Docker compose templates and configurations

This commit is contained in:
kelinfoxy
2026-03-17 17:29:50 -04:00
parent b28a11f619
commit 58306f7fe6
67 changed files with 738607 additions and 93 deletions

View File

@@ -0,0 +1,49 @@
# #######################################################
# Templating variables, not used by compose file directly
SERVER_NAME=
SERVER_IP=
SUBDOMAIN=
SERVICE_NAME=backrest
ICON_URL=https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/${SERVICE_NAME}.svg
# Include Server Name in Proxy URL? Choose one.
# PROXY_URL=${SERVICE_NAME}.${SERVER_NAME}.${SUBDOMAIN}.duckdns.org
PROXY_URL=${SERVICE_NAME}.${SUBDOMAIN}.duckdns.org
# #############################################################################
# Compose file variables
TZ=America/New_York
PUID=1000
PGID=1000
CONTAINER_NAME=${SERVICE_NAME}
INTERNAL_PORT=8081
EXTERNAL_PORT=8099
LOCAL_URL=http://${SERVER_IP}:${EXTERNAL_PORT}
STACKS_DIR=/opt
BACKUP_HOME_DIR=/home/kelin
BACKUP_DIR=/mnt/restic-usb
# #############################################################
# Container Labels
# DO NOT enclose label values in single quotes
# If the value needs to include single quotes use backticks instead
# For example HOST_LABEL=traefik.http.routers.${SERVICE_NAME}.rule=Host(`${PROXY_URL}`)
# Notice the use of backticks instead of single quotes around ${PROXY_URL}
TRAEFIK_ENABLE_LABEL=traefik.enable=true
HOST_LABEL=traefik.http.routers.${SERVICE_NAME}.rule=Host(`${PROXY_URL}`)
ICON_LABEL=com.getarcaneapp.arcane.icon=${ICON_URL}
LOADBALANCER_LABEL=traefik.http.services.${SERVICE_NAME}.loadbalancer.server.port=${INTERNAL_PORT}
TRAEFIK_NETWORK_LABEL=traefik.docker.network=traefik-network
ENTRYPOINT_LABEL=traefik.http.routers.${SERVICE_NAME}.entrypoints=websecure
CERT_LABEL=traefik.http.routers.${SERVICE_NAME}.tls.certresolver=letsencrypt
AUTHELIA_LABEL=traefik.http.routers.${SERVICE_NAME}.middlewares=authelia@docker
WATCHTOWER_ENABLE_LABEL=com.centurylinklabs.watchtower.enable=true

View File

@@ -1,2 +0,0 @@
TZ=America/New_York
STACKS_DIR=/opt/stacks

View File

@@ -1,5 +0,0 @@
# Backrest
## https://backrest.jasper.kelinreij.duckdns.org
## http://192.168.4.4:9898

View File

@@ -1,54 +0,0 @@
services:
backrest:
image: garethgeorge/backrest:latest
container_name: backrest
restart: unless-stopped
networks:
- homelab-network
- traefik-network
ports:
- '9898:9898'
volumes:
- ./data:/data
- ./config:/config
- ${STACKS_DIR}:${STACKS_DIR}:ro # Backup source
- /mnt:/mnt:ro # Backup additional drives
- ./cache:/cache
environment:
- BACKREST_DATA=/data
- BACKREST_CONFIG=/config/config.json
- TZ=${TZ}
healthcheck:
test: ['CMD', 'wget', '--quiet', '--tries=1', '--spider', 'http://localhost:9898/']
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
labels:
- 'com.centurylinklabs.watchtower.enable=true'
- 'homelab.category=utilities'
- 'homelab.description=Backup management with restic'
- 'traefik.enable=true'
- 'traefik.docker.network=traefik-network'
- 'traefik.http.routers.backrest.rule=Host(`backrest.jasper.kelinreij.duckdns.org`)'
- 'traefik.http.routers.backrest.entrypoints=websecure'
- 'traefik.http.routers.backrest.tls.certresolver=letsencrypt'
- 'traefik.http.routers.backrest.middlewares=authelia@docker'
- 'traefik.http.services.backrest.loadbalancer.server.port=9898'
networks:
homelab-network:
external: true
traefik-network:
external: true
x-dockge:
urls:
- https://${PROXY_URL}
- ${LOCAL_URL}
x-arcane:
icon: https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/backrest.svg
urls:
- https://${PROXY_URL}
- ${LOCAL_URL}

View File

@@ -0,0 +1,55 @@
services:
backrest:
image: garethgeorge/backrest:latest
container_name: backrest
restart: unless-stopped
networks:
- homelab-network
- traefik-network
ports:
- ${EXTERNAL_PORT}:${INTERNAL_PORT}
volumes:
- ./data:/data
- ./config:/config
- ./cache:/cache
- ${STACKS_DIR}:${STACKS_DIR}:ro # Backup /opt folder
- ${BACKUP_HOME_DIR}:${BACKUP_HOME_DIR}:ro # Backup home folder
- ${BACKUP_DIR}:${BACKUP_DIR} # Backup Destination
- /var/run/docker.sock:/var/run/docker.sock # Allows backrest to stop containers during backup if needed
environment:
- BACKREST_DATA=/data
- BACKREST_CONFIG=/config/config.json
- TZ=${TZ}
healthcheck:
test: ['CMD', 'wget', '--quiet', '--tries=1', '--spider', 'http://localhost:9898/']
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
labels:
- ${ICON_LABEL}
- ${HOST_LABEL}
- ${LOADBALANCER_LABEL}
- ${WATCHTOWER_ENABLE_LABEL}
- ${TRAEFIK_ENABLE_LABEL}
- ${TRAEFIK_NETWORK_LABEL}
- ${ENTRYPOINT_LABEL}
- ${CERT_LABEL}
- ${AUTHELIA_LABEL}
networks:
homelab-network:
external: true
traefik-network:
external: true
x-dockge:
urls:
- https://${PROXY_URL}
- ${LOCAL_URL}
x-arcane:
icon: ${ICON_URL}
urls:
- https://${PROXY_URL}
- ${LOCAL_URL}