Spaces:
Running
Running
Commit ·
e89a065
1
Parent(s): 95ddc8a
fix: collapse python3 -c to single line to fix dockerfile parse error
Browse files- Dockerfile +4 -11
Dockerfile
CHANGED
|
@@ -26,7 +26,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 26 |
|
| 27 |
# ---- Prepare Django Python Backend ----
|
| 28 |
COPY backend/requirements.txt ./backend/requirements.txt
|
| 29 |
-
# Upgrade pip and install requirements + gunicorn
|
| 30 |
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
|
| 31 |
&& pip install --no-cache-dir -r ./backend/requirements.txt \
|
| 32 |
&& pip install --no-cache-dir gunicorn huggingface_hub
|
|
@@ -34,19 +34,12 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
|
|
| 34 |
COPY backend/ ./backend/
|
| 35 |
|
| 36 |
# ---- Download ONNX model from Hugging Face Hub ----
|
| 37 |
-
#
|
| 38 |
-
RUN python3 -c "
|
| 39 |
-
from huggingface_hub import hf_hub_download
|
| 40 |
-
import shutil, pathlib
|
| 41 |
-
dst = pathlib.Path('/app/backend/model')
|
| 42 |
-
dst.mkdir(parents=True, exist_ok=True)
|
| 43 |
-
path = hf_hub_download(repo_id='${HF_MODEL_REPO}', filename='dermavision.onnx', local_dir=str(dst))
|
| 44 |
-
print(f'Model downloaded to {path}')
|
| 45 |
-
"
|
| 46 |
|
| 47 |
# ---- Prepare Node.js & React Frontend ----
|
| 48 |
COPY package*.json ./
|
| 49 |
-
# Force installation of devDependencies (Vite, esbuild, typescript) for building
|
| 50 |
RUN npm ci --include=dev
|
| 51 |
|
| 52 |
COPY . .
|
|
|
|
| 26 |
|
| 27 |
# ---- Prepare Django Python Backend ----
|
| 28 |
COPY backend/requirements.txt ./backend/requirements.txt
|
| 29 |
+
# Upgrade pip and install requirements + gunicorn + huggingface_hub for model download
|
| 30 |
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
|
| 31 |
&& pip install --no-cache-dir -r ./backend/requirements.txt \
|
| 32 |
&& pip install --no-cache-dir gunicorn huggingface_hub
|
|
|
|
| 34 |
COPY backend/ ./backend/
|
| 35 |
|
| 36 |
# ---- Download ONNX model from Hugging Face Hub ----
|
| 37 |
+
# Single-line form required — Dockerfile parser breaks on multi-line python3 -c "..." blocks
|
| 38 |
+
RUN python3 -c "import pathlib, huggingface_hub; dst=pathlib.Path('/app/backend/model'); dst.mkdir(parents=True, exist_ok=True); huggingface_hub.hf_hub_download(repo_id='${HF_MODEL_REPO}', filename='dermavision.onnx', local_dir=str(dst)); print('Model downloaded OK')"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
# ---- Prepare Node.js & React Frontend ----
|
| 41 |
COPY package*.json ./
|
| 42 |
+
# Force installation of devDependencies (Vite, esbuild, typescript) for building
|
| 43 |
RUN npm ci --include=dev
|
| 44 |
|
| 45 |
COPY . .
|