Skip to content

Commit

Permalink
chore(internal): improve github devcontainer setup (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Nov 8, 2023
1 parent 9a8407d commit 5334b9c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
28 changes: 5 additions & 23 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
# syntax=docker/dockerfile:1
FROM debian:bookworm-slim
ARG VARIANT="3.9"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

RUN apt-get update && apt-get install -y \
libxkbcommon0 \
ca-certificates \
make \
curl \
git \
unzip \
libc++1 \
vim \
termcap \
&& apt-get clean autoclean
USER vscode

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

WORKDIR /workspace

COPY README.md .python-version pyproject.toml requirements.lock requirements-dev.lock /workspace/

RUN rye sync --all-features

COPY . /workspace

CMD ["rye", "shell"]
RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
21 changes: 20 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,26 @@
{
"name": "Debian",
"build": {
"dockerfile": "Dockerfile"
"dockerfile": "Dockerfile",
"context": ".."
},

"postStartCommand": "rye sync --all-features",

"customizations": {
"vscode": {
"extensions": [
"ms-python.python"
],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": ".venv/bin/python",
"python.typeChecking": "basic",
"terminal.integrated.env.linux": {
"PATH": "/home/vscode/.rye/shims:${env:PATH}"
}
}
}
}

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

0 comments on commit 5334b9c

Please sign in to comment.