frontend / Dockerfile
kritish205's picture
Upload 4 files
7506572 verified
raw
history blame contribute delete
770 Bytes
# Use a specific Python version as a base image
FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt ./
# Install the Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of your application code
COPY . .
# Expose the port that Hugging Face uses
EXPOSE 7860
# Command to run the Streamlit app
# This tells Streamlit to run on the correct port and in a container-friendly way
# NEW: Add a health check to tell Hugging Face when the app is ready
HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD curl --fail http://localhost:7860/_stcore/health
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.headless=true"]