services:
  backrest:
    image: garethgeorge/backrest
    container_name: backrest
    ports:
      - ${PORT}:9898
    volumes:
      - ${DATA_DIR}/data:/data
      - ${DATA_DIR}/config:/config
      - ${DATA_DIR}/cache:/cache
      - ${TARGET_DATA_DIR}:/targets${TARGET_DATA_DIR} # mount your directories to backup somewhere in the filesystem
    environment:
      - BACKREST_DATA=/data # path for backrest data. restic binary and the database are placed here.
      - BACKREST_CONFIG=/config/config.json # path for the backrest config file.
      - XDG_CACHE_HOME=/cache # path for the restic cache which greatly improves performance.
    restart: unless-stopped