Skip to content

Commit afc867c

Browse files
chore(internal): improve github devcontainer setup (#737)
1 parent 97810fc commit afc867c

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

Diff for: .devcontainer/Dockerfile

+5-23
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,9 @@
1-
# syntax=docker/dockerfile:1
2-
FROM debian:bookworm-slim
1+
ARG VARIANT="3.9"
2+
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
33

4-
RUN apt-get update && apt-get install -y \
5-
libxkbcommon0 \
6-
ca-certificates \
7-
make \
8-
curl \
9-
git \
10-
unzip \
11-
libc++1 \
12-
vim \
13-
termcap \
14-
&& apt-get clean autoclean
4+
USER vscode
155

166
RUN curl -sSf https://rye-up.com/get | RYE_VERSION="0.15.2" RYE_INSTALL_OPTION="--yes" bash
17-
ENV PATH=/root/.rye/shims:$PATH
7+
ENV PATH=/home/vscode/.rye/shims:$PATH
188

19-
WORKDIR /workspace
20-
21-
COPY README.md .python-version pyproject.toml requirements.lock requirements-dev.lock /workspace/
22-
23-
RUN rye sync --all-features
24-
25-
COPY . /workspace
26-
27-
CMD ["rye", "shell"]
9+
RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc

Diff for: .devcontainer/devcontainer.json

+20-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,26 @@
33
{
44
"name": "Debian",
55
"build": {
6-
"dockerfile": "Dockerfile"
6+
"dockerfile": "Dockerfile",
7+
"context": ".."
8+
},
9+
10+
"postStartCommand": "rye sync --all-features",
11+
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"ms-python.python"
16+
],
17+
"settings": {
18+
"terminal.integrated.shell.linux": "/bin/bash",
19+
"python.pythonPath": ".venv/bin/python",
20+
"python.typeChecking": "basic",
21+
"terminal.integrated.env.linux": {
22+
"PATH": "/home/vscode/.rye/shims:${env:PATH}"
23+
}
24+
}
25+
}
726
}
827

928
// Features to add to the dev container. More info: https://containers.dev/features.

0 commit comments

Comments
 (0)