⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
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
2 changes: 2 additions & 0 deletions .devcontainer/.dockerfilelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rules:
sudo_usage: off
24 changes: 24 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM python:3.12-slim

# Install essential packages and create non-root user
RUN apt-get update && apt-get install -y --no-install-recommends git curl sudo bash-completion vim \
&& useradd -m -s /bin/bash vscode \
&& echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
&& mkdir -p /workspace \
&& chown vscode:vscode /workspace \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /workspace

# Switch to non-root user
USER vscode

# Set up shell completions
RUN echo 'source /usr/share/bash-completion/completions/git' >> ~/.bashrc \
&& echo 'source /etc/bash_completion' >> ~/.bashrc

# Set up uv and Python environment
RUN curl -LsSf https://astral.sh/uv/install.sh | sh

# Set up environment variables
ENV PATH="/home/vscode/.local/bin:${PATH}"
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "py-cppmodel Dev Container",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"extensions": [
"charliermarsh.ruff",
"esbenp.prettier-vscode",
"github.vscode-pull-request-github",
"ms-python.mypy-type-checker",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.jupyter",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.vscode-jupyter-slideshow",
],
"settings": {
"python.defaultInterpreterPath": "/${workspaceFolder}/.venv/bin/python",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
}
}
}
},
"mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
],
"remoteUser": "vscode",
"updateRemoteUserUID": true,
"remoteEnv": {
"UV_LINK_MODE": "copy"
}
}