Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +9 -8
Dockerfile
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
-
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Set
|
| 5 |
-
ENV HF_HOME=/
|
| 6 |
-
ENV
|
|
|
|
| 7 |
|
| 8 |
# Install OS packages
|
| 9 |
RUN apt-get update && \
|
|
@@ -13,15 +14,15 @@ RUN apt-get update && \
|
|
| 13 |
# Set working directory
|
| 14 |
WORKDIR /app
|
| 15 |
|
| 16 |
-
# Copy
|
| 17 |
COPY requirements.txt .
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
-
# Copy
|
| 21 |
COPY . .
|
| 22 |
|
| 23 |
-
# Expose
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
-
# Run
|
| 27 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Set up writable cache paths
|
| 5 |
+
ENV HF_HOME=/root/.cache/huggingface
|
| 6 |
+
ENV TRANSFORMERS_CACHE=/root/.cache/huggingface
|
| 7 |
+
ENV MPLCONFIGDIR=/root/.config/matplotlib
|
| 8 |
|
| 9 |
# Install OS packages
|
| 10 |
RUN apt-get update && \
|
|
|
|
| 14 |
# Set working directory
|
| 15 |
WORKDIR /app
|
| 16 |
|
| 17 |
+
# Copy requirements and install
|
| 18 |
COPY requirements.txt .
|
| 19 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
+
# Copy app code
|
| 22 |
COPY . .
|
| 23 |
|
| 24 |
+
# Expose port
|
| 25 |
EXPOSE 7860
|
| 26 |
|
| 27 |
+
# Run app
|
| 28 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|