Musadiq7860's picture
Update Dockerfile
f448d54 verified
Raw
History Blame Contribute Delete
890 Bytes
# Use the official Python image
FROM python:3.11-slim
# Set the working directory in the container
WORKDIR /app
# Install system dependencies needed for some Python packages
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy the requirements file first to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
COPY . .
# Hugging Face Spaces strictly requires Port 7860
EXPOSE 7860
# Healthcheck to ensure the container is running correctly on port 7860
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
# Command to run the Streamlit app specifically from the src folder
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]