Spaces:
Runtime error
Runtime error
Commit
·
1274248
1
Parent(s):
e6fbd73
deploy
Browse files- Dockerfile +10 -5
Dockerfile
CHANGED
|
@@ -1,17 +1,22 @@
|
|
| 1 |
# Use official Python base image
|
| 2 |
-
FROM python:3.11-slim
|
| 3 |
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy
|
| 8 |
-
COPY .
|
| 9 |
-
ENV TRANSFORMERS_CACHE=/app/.cache
|
| 10 |
-
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
|
| 11 |
|
| 12 |
# Install dependencies
|
| 13 |
RUN pip install --no-cache-dir -r Requirements.txt
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
# Expose port (Hugging Face uses port 7860 by default)
|
| 16 |
EXPOSE 7860
|
| 17 |
|
|
|
|
| 1 |
# Use official Python base image
|
| 2 |
+
FROM python:3.11-slim-bullseye
|
| 3 |
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy requirements file first (leverage Docker cache)
|
| 8 |
+
COPY Requirements.txt .
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# Install dependencies
|
| 11 |
RUN pip install --no-cache-dir -r Requirements.txt
|
| 12 |
|
| 13 |
+
# Copy all application files
|
| 14 |
+
COPY . /app
|
| 15 |
+
|
| 16 |
+
# Set Transformers cache directory and permissions
|
| 17 |
+
ENV TRANSFORMERS_CACHE=/app/.cache
|
| 18 |
+
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
|
| 19 |
+
|
| 20 |
# Expose port (Hugging Face uses port 7860 by default)
|
| 21 |
EXPOSE 7860
|
| 22 |
|