diff --git a/compose.yml b/compose.yml index 670e79d..c537816 100644 --- a/compose.yml +++ b/compose.yml @@ -1,41 +1,45 @@ services: - backrest: - image: garethgeorge/backrest:latest - container_name: backrest + + ${SERVICE_NAME}: + image: ${DOCKER_IMAGE} + container_name: ${CONTAINER_NAME} 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} + - ${EXTERNAL_PORT}:${INTERNAL_PORT} + + # Comment out volumes section if it is empty + #volumes: + + # Comment out environment section if it is empty + # environment: + healthcheck: - test: ['CMD', 'wget', '--quiet', '--tries=1', '--spider', 'http://localhost:9898/'] + test: ['CMD', 'wget', '--quiet', '--tries=1', '--spider', 'http://localhost:${INTERNAL_PORT}/'] 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' + # Labels in compose files are treated as literal strings, disallowing variable replacement in the string + # However the string can be defined as a variable + - ${HOST_LABEL} + - $(AUTHELIA_LABEL) + - ${TRAEFIK_ENABLE_LABEL} + - ${WATCHTOWER_ENABLE_LABEL} + - ${LOADBALANCER_LABEL} + - ${CATEGORY_LABEL} + - ${DESCRIPTION_LABEL} + # All services being proxied by Traefik must be on this network - 'traefik.docker.network=traefik-network' - - 'traefik.http.routers.backrest.rule=Host(`backrest.jasper.kelinreij.duckdns.org`)' + # This enables https - 'traefik.http.routers.backrest.entrypoints=websecure' + # This enables letsencrypt certificates - 'traefik.http.routers.backrest.tls.certresolver=letsencrypt' - - 'traefik.http.routers.backrest.middlewares=authelia@docker' - - 'traefik.http.services.backrest.loadbalancer.server.port=9898' - + # Define the category and description of this service + networks: homelab-network: @@ -43,7 +47,8 @@ networks: traefik-network: external: true + x-dockge: urls: - - https://backrest.kelinreij.duckdns.org - - https://192.168.4.4:9898 \ No newline at end of file + - https://${PROXY_URL} + - https://${LOCAL_URL}