LukeCarrier / mkdocs-drawio-exporter

Exports your Draw.io diagrams at build time for easier embedding into your documentation
https://pypi.org/project/mkdocs-drawio-exporter/
MIT License
81 stars 9 forks source link

Issue with using inside docker container #67

Closed BaluVyamajala closed 5 months ago

BaluVyamajala commented 5 months ago

Trying to setup a development server for running mkdocs locally. so, users don't have to install draw io in their mac/windows systems. But several things I have tried and finally left at below configuration which goes into infinate loop trying to export images for draw.io?

Here is my Docker file:

from python:3.8

WORKDIR /app

ARG drawio_arch=amd64
ARG drawio_version=18.1.3
ARG drawio_deb="drawio-${drawio_arch}-${drawio_version}.deb"
ARG drawio_url="https://github.com/jgraph/drawio-desktop/releases/download/v${drawio_version}/${drawio_deb}"

RUN curl -L -o "$drawio_deb" "$drawio_url"
RUN apt-get update && \
    apt-get install -y libasound2 xvfb ./"$drawio_deb"

EXPOSE 8000

COPY requirements.txt .
RUN pip install -r requirements.txt 
COPY . /docs/
COPY ./mkdocs.yml . 

ENTRYPOINT ["xvfb-run", "mkdocs"]
CMD ["serve"]

docker-compose.yaml

services:
  web:
    build: .
    volumes:
      - ./docs:/app/docs
      - ./mkdocs.yml:/app/mkdocs.yml
    ports:
      - "8000:8000"
    privileged: true
    init: true

extensions:

markdown_extensions:
  - tables
  - attr_list
plugins:
  - drawio-exporter:
      cache_dir: 'assets/drawings/drawio-exporter'
      drawio_args:
        - --no-sandbox
image

Any help would be greatly appreciated.