Update Dockerfile
Browse files- Dockerfile +7 -10
Dockerfile
CHANGED
|
@@ -12,8 +12,8 @@ RUN npm install --frozen-lockfile
|
|
| 12 |
COPY frontend/ ./
|
| 13 |
RUN npm run build
|
| 14 |
|
| 15 |
-
# --- Stage 2:
|
| 16 |
-
FROM
|
| 17 |
|
| 18 |
# Environment setup
|
| 19 |
ENV DEBIAN_FRONTEND=noninteractive \
|
|
@@ -22,9 +22,9 @@ ENV DEBIAN_FRONTEND=noninteractive \
|
|
| 22 |
PIP_NO_CACHE_DIR=1 \
|
| 23 |
HF_HOME=/app/.cache/huggingface
|
| 24 |
|
| 25 |
-
# Install system dependencies
|
| 26 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 27 |
-
|
| 28 |
rm -rf /var/lib/apt/lists/*
|
| 29 |
|
| 30 |
# Create non-root user
|
|
@@ -40,13 +40,10 @@ USER appuser
|
|
| 40 |
|
| 41 |
WORKDIR /app
|
| 42 |
|
| 43 |
-
# Upgrade pip and install
|
| 44 |
-
RUN python3 -m pip install --upgrade pip && \
|
| 45 |
-
python3 -m pip install --index-url https://download.pytorch.org/whl/cu121 torch==2.4.1+cu121
|
| 46 |
-
|
| 47 |
-
# Install Python dependencies
|
| 48 |
COPY backend/requirements.txt /app/backend/requirements.txt
|
| 49 |
-
RUN python3 -m pip install
|
|
|
|
| 50 |
|
| 51 |
# Copy backend code
|
| 52 |
COPY backend/ /app/backend/
|
|
|
|
| 12 |
COPY frontend/ ./
|
| 13 |
RUN npm run build
|
| 14 |
|
| 15 |
+
# --- Stage 2: Python backend (CPU only) ---
|
| 16 |
+
FROM python:3.10-slim AS backend
|
| 17 |
|
| 18 |
# Environment setup
|
| 19 |
ENV DEBIAN_FRONTEND=noninteractive \
|
|
|
|
| 22 |
PIP_NO_CACHE_DIR=1 \
|
| 23 |
HF_HOME=/app/.cache/huggingface
|
| 24 |
|
| 25 |
+
# Install system dependencies
|
| 26 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 27 |
+
git curl && \
|
| 28 |
rm -rf /var/lib/apt/lists/*
|
| 29 |
|
| 30 |
# Create non-root user
|
|
|
|
| 40 |
|
| 41 |
WORKDIR /app
|
| 42 |
|
| 43 |
+
# Upgrade pip and install Python dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
COPY backend/requirements.txt /app/backend/requirements.txt
|
| 45 |
+
RUN python3 -m pip install --upgrade pip && \
|
| 46 |
+
python3 -m pip install -r /app/backend/requirements.txt
|
| 47 |
|
| 48 |
# Copy backend code
|
| 49 |
COPY backend/ /app/backend/
|