Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -11
Dockerfile
CHANGED
@@ -1,22 +1,21 @@
|
|
1 |
-
# Use Python 3.11 slim base image
|
2 |
FROM python:3.11-slim
|
3 |
|
4 |
-
# Install
|
|
|
|
|
|
|
5 |
COPY requirements.txt .
|
6 |
RUN pip install --no-cache-dir -r requirements.txt
|
7 |
|
8 |
-
#
|
9 |
-
RUN pip install --no-cache-dir scikit-learn==1.6.1
|
10 |
-
|
11 |
-
# Set Hugging Face cache directory to avoid permission issues
|
12 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface
|
13 |
|
14 |
-
# Copy
|
15 |
COPY . /app
|
16 |
WORKDIR /app
|
17 |
|
18 |
-
# Expose
|
19 |
-
EXPOSE
|
20 |
|
21 |
-
# Run the FastAPI app
|
22 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
|
1 |
FROM python:3.11-slim
|
2 |
|
3 |
+
# Install system deps for torch/transformers (optional but recommended)
|
4 |
+
RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/*
|
5 |
+
|
6 |
+
# Copy requirements and install dependencies
|
7 |
COPY requirements.txt .
|
8 |
RUN pip install --no-cache-dir -r requirements.txt
|
9 |
|
10 |
+
# Set HF cache to avoid permission issues
|
|
|
|
|
|
|
11 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface
|
12 |
|
13 |
+
# Copy app code
|
14 |
COPY . /app
|
15 |
WORKDIR /app
|
16 |
|
17 |
+
# Expose port (change to 8000 if you want standard)
|
18 |
+
EXPOSE 8000
|
19 |
|
20 |
+
# Run the FastAPI app on port 8000
|
21 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|