Skip to content

Commit

Permalink
Better way of installing uv?
Browse files Browse the repository at this point in the history
  • Loading branch information
perfectly-preserved-pie committed Nov 12, 2024
1 parent 48287ef commit 477de27
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
FROM python:3.11-slim

COPY requirements.txt .
WORKDIR /app

# Switch to root user to install dependencies
USER root

# Copy everything into the working directory
COPY . /app

# Copy uv binary directly from the UV container image
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv

# Install dependencies directly into the system environment using uv
RUN uv pip install --system --no-cache-dir -r requirements.txt

# Switch back to non-root user
USER nonroot

# Install curl
RUN apt-get update && apt-get install -y curl
Expand Down

0 comments on commit 477de27

Please sign in to comment.