Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +19 -4
Dockerfile
CHANGED
|
@@ -1,15 +1,30 @@
|
|
| 1 |
-
FROM python:3.10-slim
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
-
COPY . .
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
pip install -r requirements.txt --no-cache-dir && \
|
| 9 |
python -m spacy download en_core_web_sm && \
|
| 10 |
python -m nltk.downloader punkt wordnet
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
ENV STREAMLIT_SERVER_PORT=7860
|
|
|
|
|
|
|
| 13 |
EXPOSE 7860
|
| 14 |
|
| 15 |
CMD ["streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
|
| 3 |
WORKDIR /app
|
|
|
|
| 4 |
|
| 5 |
+
# Install system dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
gcc \
|
| 8 |
+
python3-dev \
|
| 9 |
+
libgomp1 \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
# Copy requirements first to leverage Docker cache
|
| 13 |
+
COPY requirements.txt .
|
| 14 |
+
|
| 15 |
+
# Install Python dependencies
|
| 16 |
+
RUN pip install --upgrade pip && \
|
| 17 |
pip install -r requirements.txt --no-cache-dir && \
|
| 18 |
python -m spacy download en_core_web_sm && \
|
| 19 |
python -m nltk.downloader punkt wordnet
|
| 20 |
|
| 21 |
+
# Copy the rest of the application
|
| 22 |
+
COPY . .
|
| 23 |
+
|
| 24 |
+
# Environment variables
|
| 25 |
ENV STREAMLIT_SERVER_PORT=7860
|
| 26 |
+
ENV HUGGINGFACEHUB_API_TOKEN=your_huggingface_token_here
|
| 27 |
+
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
CMD ["streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|