Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +25 -18
Dockerfile
CHANGED
|
@@ -1,25 +1,32 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
# Set working directory
|
| 10 |
-
WORKDIR
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
COPY
|
| 14 |
-
RUN pip install --no-cache-dir --upgrade pip && \
|
| 15 |
-
pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official Python image
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# 1. Install System Dependencies (LaTeX)
|
| 5 |
+
# We use --no-install-recommends to keep the image smaller, but install the necessary parts.
|
| 6 |
+
RUN apt-get update && \
|
| 7 |
+
apt-get install -y \
|
| 8 |
+
texlive-latex-base \
|
| 9 |
+
texlive-latex-extra \
|
| 10 |
+
texlive-science \
|
| 11 |
+
texlive-fonts-recommended \
|
| 12 |
+
texlive-fonts-extra \
|
| 13 |
+
ghostscript \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# 2. Set up the working directory
|
| 17 |
+
WORKDIR /app
|
| 18 |
|
| 19 |
+
# 3. Copy your specific requirements file first (for caching)
|
| 20 |
+
COPY requirements.txt .
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
# 4. Install Python dependencies
|
| 23 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
|
| 25 |
+
# 5. Copy the rest of your application code
|
| 26 |
+
COPY . .
|
| 27 |
|
| 28 |
+
# 6. Expose the port used by Streamlit (7860 is standard for Hugging Face)
|
| 29 |
+
EXPOSE 7860
|
| 30 |
|
| 31 |
+
# 7. Run the application
|
| 32 |
+
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|