Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +28 -42
Dockerfile
CHANGED
|
@@ -1,49 +1,35 @@
|
|
| 1 |
-
# ββ OpenEnv:
|
| 2 |
-
#
|
| 3 |
-
#
|
| 4 |
-
#
|
| 5 |
-
#
|
| 6 |
-
#
|
| 7 |
-
# HF_USERNAME β your HF username (default: soonvalley04)
|
| 8 |
-
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 9 |
|
| 10 |
-
FROM python:3.10-slim
|
| 11 |
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
RUN apt-get update && apt-get
|
| 16 |
-
|
| 17 |
-
&& apt-get clean
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
RUN pip install --no-cache-dir --upgrade pip
|
| 23 |
-
pip install --no-cache-dir
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
"torchaudio==2.10.0" \
|
| 27 |
-
--index-url https://download.pytorch.org/whl/cu128
|
| 28 |
-
|
| 29 |
-
# ββ 2. Install Unsloth + Training Stack (Correct Dependencies) ββββββββββββββ
|
| 30 |
-
RUN pip install --no-cache-dir \
|
| 31 |
-
"unsloth @ git+https://github.com/unslothai/unsloth.git" \
|
| 32 |
-
"unsloth_zoo" \
|
| 33 |
-
"trl" \
|
| 34 |
-
"datasets" \
|
| 35 |
-
"matplotlib" \
|
| 36 |
-
"pydantic" \
|
| 37 |
-
"networkx" \
|
| 38 |
-
"python-dotenv" \
|
| 39 |
-
"huggingface_hub" \
|
| 40 |
-
"openai" \
|
| 41 |
-
"bitsandbytes" \
|
| 42 |
-
"xformers" \
|
| 43 |
-
"torchao>=0.16.0"
|
| 44 |
-
|
| 45 |
-
# Copy repo source
|
| 46 |
COPY . .
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
# Run the FastAPI server (app:app = the `app` FastAPI instance in app.py)
|
| 49 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|
|
|
|
|
|
| 1 |
+
# ββ OpenEnv: Distributed Data Cluster Triage ββββββββββββββββββββββββββββββ
|
| 2 |
+
# Serves:
|
| 3 |
+
# β’ OpenEnv HTTP API: POST /reset, POST /step, GET /state, GET /health
|
| 4 |
+
# β’ HTML Frontend: GET / (interactive dashboard)
|
| 5 |
+
# Port: 7860 (required for Hugging Face Spaces)
|
| 6 |
+
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
FROM python:3.10.14-slim-bookworm
|
| 9 |
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
+
# Apply latest security patches
|
| 13 |
+
RUN apt-get update && apt-get upgrade -y \
|
| 14 |
+
&& apt-get install -y --no-install-recommends curl \
|
| 15 |
+
&& apt-get clean \
|
| 16 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
+
|
| 18 |
+
# Install Python dependencies first (Docker cache layer)
|
| 19 |
+
COPY requirements.txt .
|
| 20 |
+
RUN pip install --no-cache-dir --upgrade pip \
|
| 21 |
+
&& pip install --no-cache-dir -r requirements.txt
|
| 22 |
+
|
| 23 |
+
# Copy environment source
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
COPY . .
|
| 25 |
|
| 26 |
+
# Health check β confirms the FastAPI server is live
|
| 27 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
|
| 28 |
+
CMD curl -f http://localhost:7860/health || exit 1
|
| 29 |
+
|
| 30 |
+
# Expose Hugging Face Spaces port
|
| 31 |
+
EXPOSE 7860
|
| 32 |
+
|
| 33 |
# Run the FastAPI server (app:app = the `app` FastAPI instance in app.py)
|
| 34 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|
| 35 |
+
|