Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -3
Dockerfile
CHANGED
|
@@ -3,6 +3,12 @@ FROM python:3.10-slim
|
|
| 3 |
# Set working directory
|
| 4 |
WORKDIR /code
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
# Install dependencies
|
| 7 |
COPY requirements.txt .
|
| 8 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
@@ -10,8 +16,5 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 10 |
# Copy app code
|
| 11 |
COPY app /code/app
|
| 12 |
|
| 13 |
-
# Set environment variables
|
| 14 |
-
ENV TRANSFORMERS_CACHE=/code/cache
|
| 15 |
-
|
| 16 |
# Expose port and run
|
| 17 |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 3 |
# Set working directory
|
| 4 |
WORKDIR /code
|
| 5 |
|
| 6 |
+
# Create HF cache directory with write permissions
|
| 7 |
+
RUN mkdir -p /code/cache && chmod -R 777 /code/cache
|
| 8 |
+
|
| 9 |
+
# Set environment variables
|
| 10 |
+
ENV TRANSFORMERS_CACHE=/code/cache
|
| 11 |
+
|
| 12 |
# Install dependencies
|
| 13 |
COPY requirements.txt .
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 16 |
# Copy app code
|
| 17 |
COPY app /code/app
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
# Expose port and run
|
| 20 |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|