Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
update uv handling in dockerfile
Browse files- Dockerfile +19 -16
Dockerfile
CHANGED
|
@@ -11,30 +11,33 @@ RUN npm run build
|
|
| 11 |
FROM python:3.12-slim
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
# Install
|
| 18 |
-
RUN
|
|
|
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
RUN
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
# Create and configure cache directory
|
| 24 |
RUN mkdir -p /app/.cache && \
|
| 25 |
chown -R user:user /app
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
RUN apt-get update && apt-get install -y \
|
| 29 |
-
git \
|
| 30 |
-
curl \
|
| 31 |
-
netcat-openbsd \
|
| 32 |
-
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
|
| 33 |
-
&& apt-get install -y nodejs \
|
| 34 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 35 |
-
|
| 36 |
-
# Copy and install backend dependencies
|
| 37 |
COPY backend/pyproject.toml ./
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
RUN uv pip install -e . --system
|
| 39 |
|
| 40 |
# Copy backend code
|
|
|
|
| 11 |
FROM python:3.12-slim
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
+
# Install system dependencies required for UV, Git and Node.js
|
| 15 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 16 |
+
curl ca-certificates git netcat-openbsd && \
|
| 17 |
+
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
|
| 18 |
+
apt-get install -y nodejs && \
|
| 19 |
+
rm -rf /var/lib/apt/lists/*
|
| 20 |
|
| 21 |
+
# Install UV (fast Python dependency manager)
|
| 22 |
+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
| 23 |
+
mv /root/.local/bin/uv /usr/local/bin/uv && chmod +x /usr/local/bin/uv
|
| 24 |
|
| 25 |
+
# Verify UV installation
|
| 26 |
+
RUN uv --version
|
| 27 |
+
|
| 28 |
+
# Create non-root user
|
| 29 |
+
RUN useradd -m -u 1000 user
|
| 30 |
|
| 31 |
# Create and configure cache directory
|
| 32 |
RUN mkdir -p /app/.cache && \
|
| 33 |
chown -R user:user /app
|
| 34 |
|
| 35 |
+
# Copy backend requirements
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
COPY backend/pyproject.toml ./
|
| 37 |
+
|
| 38 |
+
# Install all dependencies explicitly
|
| 39 |
+
RUN pip install fastapi uvicorn
|
| 40 |
+
# Install project dependencies
|
| 41 |
RUN uv pip install -e . --system
|
| 42 |
|
| 43 |
# Copy backend code
|