From 5b80876947eb38a6cdf0b354ba573ddf6f29f18d Mon Sep 17 00:00:00 2001 From: Kyriakos Akriotis Date: Tue, 16 Apr 2024 10:15:07 +0000 Subject: [PATCH 1/2] added devcontainer support --- .devcontainer/Dockerfile | 28 ++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 20 ++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..8ec78b367 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,28 @@ +# use latest python 3 alpine image. +FROM python:3-alpine + +# install system dependencies. +RUN apk update && apk add --no-cache \ + gcc libc-dev g++ graphviz git bash go imagemagick inkscape ttf-opensans curl fontconfig xdg-utils + +# install go package. +RUN go install github.com/mingrammer/round@latest + +# install fonts +RUN curl -O https://noto-website.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip \ +&& mkdir -p /usr/share/fonts/NotoSansCJKjp \ +&& unzip NotoSansCJKjp-hinted.zip -d /usr/share/fonts/NotoSansCJKjp/ \ +&& rm NotoSansCJKjp-hinted.zip \ +&& fc-cache -fv + +# add go bin to path. +ENV PATH "$PATH:/root/go/bin" + +# project directory. +WORKDIR /usr/src/diagrams + +# Copy the rest of your app's source code from your host to your image filesystem. +COPY . . + +# install python requirements. +RUN pip install black graphviz jinja2 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..ec9c08b74 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,20 @@ +{ + "name": "diagrams", + "build": { + // Path is relative to the devcontainer.json file. + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "ms-python.debugpy", + "mhutchie.git-graph", + "mutantdino.resourcemonitor", + "tehpeng.diagramspreviewer" + ] + } + }, + "workspaceMount": "source=${localWorkspaceFolder},target=/usr/src/diagrams,type=bind", + "workspaceFolder": "/usr/src/diagrams" +} \ No newline at end of file From ab74d01582fc4d92869576f5f9cea00b5d5b0098 Mon Sep 17 00:00:00 2001 From: Kyriakos Akriotis Date: Tue, 16 Apr 2024 12:57:02 +0000 Subject: [PATCH 2/2] added nodejs & npm to image --- .devcontainer/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 8ec78b367..2c39972c7 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,8 @@ FROM python:3-alpine # install system dependencies. RUN apk update && apk add --no-cache \ - gcc libc-dev g++ graphviz git bash go imagemagick inkscape ttf-opensans curl fontconfig xdg-utils + gcc libc-dev g++ graphviz git bash go imagemagick inkscape ttf-opensans curl fontconfig xdg-utils \ + nodejs npm # install go package. RUN go install github.com/mingrammer/round@latest