Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +1 -18
Dockerfile
CHANGED
|
@@ -1,27 +1,10 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
-
|
| 3 |
-
# Prevent Python from writing pyc files
|
| 4 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 5 |
ENV PYTHONUNBUFFERED=1
|
| 6 |
-
|
| 7 |
WORKDIR /app
|
| 8 |
-
|
| 9 |
-
# Install system dependencies (required for sklearn / xgboost)
|
| 10 |
-
RUN apt-get update && apt-get install -y \
|
| 11 |
-
build-essential \
|
| 12 |
-
gcc \
|
| 13 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
-
|
| 15 |
-
# Copy and install dependencies first (better caching)
|
| 16 |
COPY requirements.txt .
|
| 17 |
RUN pip install --no-cache-dir --upgrade pip \
|
| 18 |
&& pip install --no-cache-dir -r requirements.txt
|
| 19 |
-
|
| 20 |
-
# Copy application code
|
| 21 |
COPY . .
|
| 22 |
-
|
| 23 |
-
# Hugging Face expects port 7860
|
| 24 |
EXPOSE 7860
|
| 25 |
-
|
| 26 |
-
# Start FastAPI
|
| 27 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
|
|
|
|
|
|
| 2 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 3 |
ENV PYTHONUNBUFFERED=1
|
|
|
|
| 4 |
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
COPY requirements.txt .
|
| 6 |
RUN pip install --no-cache-dir --upgrade pip \
|
| 7 |
&& pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
| 8 |
COPY . .
|
|
|
|
|
|
|
| 9 |
EXPOSE 7860
|
| 10 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|