From 5b80876947eb38a6cdf0b354ba573ddf6f29f18d Mon Sep 17 00:00:00 2001 From: Kyriakos Akriotis Date: Tue, 16 Apr 2024 10:15:07 +0000 Subject: [PATCH] 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 00000000..8ec78b36 --- /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 00000000..ec9c08b7 --- /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