Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -17
Dockerfile
CHANGED
|
@@ -1,29 +1,29 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
FROM python:3.
|
| 3 |
|
| 4 |
-
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Install system dependencies
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
software-properties-common \
|
| 12 |
-
git \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
-
# Copy requirements
|
| 16 |
-
COPY requirements.txt .
|
| 17 |
-
COPY src/ ./src/
|
| 18 |
|
| 19 |
# Install Python dependencies
|
| 20 |
-
RUN
|
| 21 |
|
| 22 |
-
#
|
|
|
|
|
|
|
|
|
|
| 23 |
EXPOSE 8501
|
| 24 |
|
| 25 |
-
#
|
| 26 |
-
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
|
|
|
|
| 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 dependencies (for PIL and other libraries)
|
| 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 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 |
+
# Command to run the Streamlit app
|
| 29 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|