andig / carddav2fb

Download CardDAV VCards and upload as phonebook to AVM FRITZ!Box
63 stars 19 forks source link

Docker: Sync more than one phonebook #226

Open KingKahn123 opened 3 years ago

KingKahn123 commented 3 years ago

Hi,

I have 4 different phonebooks in fritzbox defined. Therefore I have 4 different config files created. Is it possible to sync all 4 phonebooks with one docker container via the cron job?

git-developer commented 5 months ago

This is an example for a single docker-compose.yml with one service (container) per phonebook:

---
x-base: &base
  image: andig/carddav2fb
  restart: unless-stopped
  entrypoint: [ '/bin/sh', '-c', 'update-ca-certificates && exec /srv/docker-entrypoint' ]
  init: true

services:
  carddav2fb-a:
    container_name: carddav2fb-a
    volumes:
      - ./a:/data
      - ./certs:/usr/local/share/ca-certificates:ro
    <<: *base

  carddav2fb-b:
    container_name: carddav2fb-b
    volumes:
      - ./b:/data
      - ./certs:/usr/local/share/ca-certificates:ro
    <<: *base

Each phonebook has its own subdirectory (./a, ./b) with its own configuration. The entrypoint is overriden to allow HTTPS using a custom CA (certificates go into certs).

It might not be exactly what you're looking for, but it reduces the configuration overhead for multiple phonebooks.