Spaces:
Sleeping
Sleeping
# Use official slim Python base image | |
FROM python:3.10-slim | |
# Prevent Python from writing .pyc files | |
ENV PYTHONDONTWRITEBYTECODE=1 | |
# Buffer stdout/stderr for easier logging | |
ENV PYTHONUNBUFFERED=1 | |
# Install OS dependencies | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential \ | |
libgl1-mesa-glx \ | |
libglib2.0-0 \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Set working directory | |
WORKDIR /app | |
# Copy and install Python dependencies | |
COPY requirements.txt ./ | |
RUN pip install --upgrade pip \ | |
&& pip install --no-cache-dir -r requirements.txt | |
# Copy application code | |
COPY . /app | |
# Expose Streamlit default port | |
EXPOSE 8501 | |
# Run the Streamlit app on container start | |
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] | |