services:
  kiwix:
    extends:
      file: ${TEMPLATES_PATH}
      service: default
    image: ghcr.io/kiwix/kiwix-serve:3.8.1
    container_name: kiwix
    ports:
      - 2009:8080
    networks:
      - ip4net
    volumes:
      - ${EXTERNAL_STORAGE}/wikipedia/:/data
    command:
      - "*.zim"
    labels:
      # Traefik
      - "traefik.enable=true"
      - "traefik.http.routers.kiwix.rule=Host(`wikipedia.${LOCAL_DOMAIN}`)"
      - "traefik.http.routers.kiwix.entrypoints=https"
      - "traefik.http.routers.kiwix.tls=true"
      - "traefik.http.services.kiwix.loadbalancer.server.port=8080"
