From 0671c7b17873b61231930767fa5f0c54fe366872 Mon Sep 17 00:00:00 2001 From: Lionel Chamorro Date: Mon, 24 Mar 2025 17:11:11 -0300 Subject: [PATCH] Add UV support to Dockerfile and update postCreateCommand --- .devcontainer/Dockerfile | 10 ++++++++++ .devcontainer/devcontainer.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 361aecf..6e4d522 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,3 +1,7 @@ +# Stage - UV +ARG UV_VERSION=0.5.11 +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_source + # .devcontainer/Dockerfile FROM python:3.11 @@ -7,9 +11,15 @@ RUN apt-get update # Install pip RUN apt-get install -y python3-pip +# Install uv +COPY --from=uv_source /uv /uvx /bin/ + # Install any necessary dependencies RUN apt-get install -y build-essential libssl-dev libffi-dev python3-dev + +RUN uv venv + # # Copy requirements.txt and install the requirements # COPY requirements.txt . # RUN pip install -r requirements.txt diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 84c0077..658fd16 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,7 @@ "forwardPorts": [ 8888 ], - "postCreateCommand": "pip install -r requirements.txt", + "postCreateCommand": "uv venv && uv pip install -r requirements.txt", "customizations": { "vscode": { "extensions": [