Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Rust v1.77 as a base image
FROM rust:1.77-slim

RUN apt-get update && \
apt-get install -y --no-install-recommends \
git openssh-client \
curl \
# install python3, jinja2 pyyaml
python3 \
python3-pip \
ARG USERNAME=typst-jp
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& chsh -s /bin/bash $USERNAME \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
git \
openssh-client \
python3 \
python3-pip \
&& python3 -m pip install --break-system-packages jinja2 PyYAML \
# install nodejs and serve
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g [email protected] \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /workspace
ENV PATH="/root/.cargo/bin:${PATH}"
USER $USERNAME
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"dockerfile": "Dockerfile",
"context": ".."
},
"forwardPorts": [3000],
"remoteUser": "typst-jp",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"workspaceFolder": "/workspace",
"postStartCommand": "cargo test --package typst-docs --lib -- tests::test_docs --exact --nocapture && python3 ./gen.py && npx serve -n ./dist"
"postStartCommand": "cargo test --package typst-docs --lib -- tests::test_docs --exact --nocapture && python3 ./gen.py && python3 -m http.server -d dist",
"postCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}"
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"label": "gen: typst-jp documentation",
"type": "shell",
"command": "cargo test --package typst-docs --lib -- tests::test_docs --exact --nocapture && python3 ./gen.py && echo reload or open http://localhost:3000",
"command": "cargo test --package typst-docs --lib -- tests::test_docs --exact --nocapture && python3 ./gen.py && echo reload or open http://localhost:8000",
"problemMatcher": []
}
]
Expand Down
Loading