Spaces:
Runtime error
Runtime error
Commit
·
11406d1
1
Parent(s):
b438270
firstCommit5
Browse files- Dockerfile +9 -8
Dockerfile
CHANGED
|
@@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y \
|
|
| 7 |
libglib2.0-0 \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
# Install
|
| 11 |
COPY requirements.txt .
|
| 12 |
RUN pip install --upgrade pip
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
@@ -15,15 +15,16 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 15 |
# Copy app code
|
| 16 |
COPY main.py .
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
RUN mkdir -p /app/
|
| 20 |
-
ENV TRANSFORMERS_CACHE=/app/cache
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
|
| 25 |
-
#
|
| 26 |
ENV HF_TOKEN=$HF_TOKEN
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
|
| 7 |
libglib2.0-0 \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
# Install dependencies
|
| 11 |
COPY requirements.txt .
|
| 12 |
RUN pip install --upgrade pip
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 15 |
# Copy app code
|
| 16 |
COPY main.py .
|
| 17 |
|
| 18 |
+
# Make writable cache folder
|
| 19 |
+
RUN mkdir -p /app/hf_cache
|
|
|
|
| 20 |
|
| 21 |
+
# ✅ Set correct environment variable
|
| 22 |
+
ENV HF_HOME=/app/hf_cache
|
| 23 |
|
| 24 |
+
# If you're passing HF_TOKEN via platform settings, keep this:
|
| 25 |
ENV HF_TOKEN=$HF_TOKEN
|
| 26 |
|
| 27 |
+
EXPOSE 8000
|
| 28 |
+
|
| 29 |
+
# Run your app (change main:app if needed)
|
| 30 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|