Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +7 -11
Dockerfile
CHANGED
|
@@ -1,29 +1,25 @@
|
|
| 1 |
-
# Use an official Python runtime as the base image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
# Set working directory in the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Install system
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
libjpeg-dev \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
zlib1g-dev \
|
|
|
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# Copy requirements.txt to the working directory
|
| 14 |
COPY requirements.txt .
|
| 15 |
-
|
| 16 |
-
# Install Python dependencies
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
-
# Copy the app files to the working directory
|
| 20 |
COPY src/streamlit_app.py .
|
| 21 |
|
| 22 |
-
# Expose the port Streamlit uses
|
| 23 |
EXPOSE 8501
|
| 24 |
|
| 25 |
-
# Set environment variables for Hugging Face token (optional, can be passed at runtime)
|
| 26 |
ENV HF_TOKEN=""
|
| 27 |
|
| 28 |
-
|
| 29 |
-
CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection", "false"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system libraries required by PIL (Pillow) and Streamlit
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
libjpeg-dev \
|
| 8 |
+
libpng-dev \
|
| 9 |
+
libtiff-dev \
|
| 10 |
+
libopenjp2-7 \
|
| 11 |
+
libfreetype6-dev \
|
| 12 |
zlib1g-dev \
|
| 13 |
+
fonts-dejavu-core \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
|
|
|
| 16 |
COPY requirements.txt .
|
|
|
|
|
|
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
|
|
|
| 19 |
COPY src/streamlit_app.py .
|
| 20 |
|
|
|
|
| 21 |
EXPOSE 8501
|
| 22 |
|
|
|
|
| 23 |
ENV HF_TOKEN=""
|
| 24 |
|
| 25 |
+
CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection", "false"]
|
|
|