Skip to content

Commit a56ac6d

Browse files
committed
fix: resolve devcontainer venv installation
1 parent 97e0a7b commit a56ac6d

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM mcr.microsoft.com/vscode/devcontainers/base:debian
2+
3+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
4+
5+
RUN \
6+
apt-get update \
7+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
8+
ffmpeg \
9+
libpcap-dev \
10+
libudev-dev \
11+
libyaml-dev \
12+
libxml2 \
13+
cmake \
14+
autoconf \
15+
&& apt-get clean \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
19+
20+
USER vscode
21+
22+
RUN uv python install 3.13
23+
24+
WORKDIR /workspaces

.devcontainer/devcontainer.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"name": "Linus Dashboard",
3-
"image": "mcr.microsoft.com/devcontainers/python:1-3.13-bookworm",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
46

57
"features": {
68
"ghcr.io/devcontainers/features/node:1": {
@@ -9,9 +11,17 @@
911
"ghcr.io/devcontainers/features/github-cli:1": {}
1012
},
1113

14+
"mounts": [
15+
{
16+
"source": "${localWorkspaceFolder}/../sapiens",
17+
"target": "/workspaces/sapiens",
18+
"type": "bind"
19+
}
20+
],
21+
1222
"onCreateCommand": [
1323
"bash", "-c",
14-
"sudo apt-get update && sudo apt-get install -y ffmpeg libpcap-dev && python -m venv ha-env && ./ha-env/bin/pip install -U pip setuptools wheel && ./ha-env/bin/pip install -r requirements.txt && npm install"
24+
"rm -rf ha-env && uv venv ha-env && uv pip install --python ha-env/bin/python -r requirements.txt && npm install"
1525
],
1626

1727
"postStartCommand": [

0 commit comments

Comments
 (0)