Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +14 -16
Dockerfile
CHANGED
|
@@ -1,26 +1,24 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
RUN apt-get update && apt-get install -y \
|
| 6 |
-
build-essential curl git \
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
|
|
|
|
|
|
| 9 |
COPY requirements.txt .
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
| 12 |
-
# Download spaCy
|
| 13 |
-
RUN python -m spacy download en_core_web_sm
|
| 14 |
-
|
| 15 |
COPY app.py .
|
| 16 |
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
-
EXPOSE
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
# libgomp1 is needed by faiss-cpu on slim images
|
| 4 |
+
RUN apt-get update && apt-get install -y --no-install-recommends libgomp1 \
|
|
|
|
|
|
|
| 5 |
&& rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
+
WORKDIR /app
|
| 8 |
+
|
| 9 |
COPY requirements.txt .
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
COPY app.py .
|
| 13 |
|
| 14 |
+
ENV HF_HOME=/tmp/hf \
|
| 15 |
+
STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
|
| 16 |
|
| 17 |
+
EXPOSE 7860
|
| 18 |
|
| 19 |
+
# XSRF/CORS are disabled because file uploads fail inside the Hugging Face Spaces iframe otherwise
|
| 20 |
+
CMD ["streamlit", "run", "app.py", \
|
| 21 |
+
"--server.port=7860", \
|
| 22 |
+
"--server.address=0.0.0.0", \
|
| 23 |
+
"--server.enableXsrfProtection=false", \
|
| 24 |
+
"--server.enableCORS=false"]
|