services:
  duplicati:
    image: lscr.io/linuxserver/duplicati:latest
    container_name: duplicati
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - CLI_ARGS= #optional
      - SETTINGS_ENCRYPTION_KEY=${SETTINGS_ENCRYPTION_KEY}
      - DUPLICATI__WEBSERVICE_PASSWORD=${DUPLICATI__WEBSERVICE_PASSWORD}

    volumes:
      - ./config:/config
      - ./backups:/backups
      # Add paths to what you want to backup
      - /home/orangepi:/source/home:ro  # Backup home directory (read-only)
      - type: volume
        source: synology_homes
        target: /source/synology
        volume:
          nocopy: true
    ports:
      - 8200:8200
    restart: unless-stopped
    env_file:
      - .env

volumes:
  synology_homes:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.2.132,rw,nfsvers=3,nolock
      device: ":/volume1/homes"
