From 6facff1e8b012835b19526fb363ddcf3c4899e9f Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Fri, 8 Mar 2024 14:29:32 +0000 Subject: [PATCH] Add development container for docs Signed-off-by: Dogan Ulus --- .devcontainer/Dockerfile | 24 ++++++++++++++++++++++++ .devcontainer/devcontainer.json | 20 ++++++++++++++++++++ requirements.txt | 15 +++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 requirements.txt diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000000..79279841612 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,24 @@ +FROM ubuntu:22.04 + +ARG USER=autoware +ENV HOME /home/$USER +ENV PATH=$PATH:/home/$USER/.local/bin + +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install \ + sudo \ + git \ + python3 \ + python3-pip \ + python-is-python3 \ + && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* + +RUN groupadd work -g 1000 \ + && useradd -ms /bin/bash $USER -g 1000 -u 1000 \ + && printf "$USER:$USER" | chpasswd \ + && printf "$USER ALL= NOPASSWD: ALL\\n" >> /etc/sudoers + +USER $USER +WORKDIR $HOME + +RUN python -m pip install --user --no-cache-dir pre-commit diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..97e65e6e3e6 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,20 @@ +{ + "name": "Autoware Docs", + "dockerFile": "Dockerfile", + "context": "..", + "customizations": { + "vscode": { + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + "extensions": [ + "redhat.vscode-yaml", + "esbenp.prettier-vscode", + "DavidAnson.vscode-markdownlint" + ] + } + }, + "forwardPorts": [8000], + "postCreateCommand": "pip install --user -r requirements.txt && pre-commit install", + "remoteUser": "autoware" +} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000000..b3f785d2b86 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,15 @@ +mkdocs +mkdocs-material +mkdocs-minify-plugin +mkdocs-redirects +mkdocs-git-revision-date-localized-plugin +mkdocs-awesome-pages-plugin +mkdocs-exclude +mkdocs-macros-plugin +mkdocs-video +mkdocs-same-dir +markdown<3.4 +fontawesome-markdown +python-markdown-math +mdx_truly_sane_lists +plantuml-markdown