Devang1290 commited on
Commit
5ef9cdf
·
1 Parent(s): 2cb327c

perf: switch from pip to uv for 10x faster Docker builds

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -4
Dockerfile CHANGED
@@ -9,6 +9,9 @@ RUN apt-get update && apt-get install -y \
9
  curl \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
 
 
12
  # Hugging Face Spaces requires a non-root user
13
  RUN useradd -m -u 1000 user
14
  USER user
@@ -20,10 +23,10 @@ WORKDIR /app
20
  # Copy requirements first for better Docker layer caching
21
  COPY --chown=user:user requirements-ci-english.txt requirements-ci-hindi.txt ./
22
 
23
- # Install Python dependencies
24
- RUN pip install --no-cache-dir fastapi uvicorn pydantic
25
- RUN pip install --no-cache-dir -r requirements-ci-english.txt
26
- RUN pip install --no-cache-dir -r requirements-ci-hindi.txt
27
 
28
  # Copy the rest of the project
29
  COPY --chown=user:user . /app
 
9
  curl \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Install uv for blazing-fast pip installs
13
+ RUN pip install uv
14
+
15
  # Hugging Face Spaces requires a non-root user
16
  RUN useradd -m -u 1000 user
17
  USER user
 
23
  # Copy requirements first for better Docker layer caching
24
  COPY --chown=user:user requirements-ci-english.txt requirements-ci-hindi.txt ./
25
 
26
+ # Install Python dependencies with uv (10x faster than pip)
27
+ RUN uv pip install --system --no-cache fastapi uvicorn pydantic
28
+ RUN uv pip install --system --no-cache -r requirements-ci-english.txt
29
+ RUN uv pip install --system --no-cache -r requirements-ci-hindi.txt
30
 
31
  # Copy the rest of the project
32
  COPY --chown=user:user . /app