mahmoudalrefaey's picture
Update Dockerfile
993b50c verified
# Use an official Python base image
FROM python:3.9
# Set environment variables
ENV PORT 7860
ENV PYTHONUNBUFFERED=1
# Set workdir
WORKDIR /app
# Install system dependencies (if needed)
RUN apt-get update && apt-get install -y \
build-essential \
libgl1 \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
ffmpeg \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN ldconfig
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Copy the rest of your code
COPY . .
# Expose the port Streamlit will run on
EXPOSE 7860
# Run Streamlit on container start
CMD streamlit run app.py --server.port $PORT --server.address 0.0.0.0