# Use the official Python 3.10 slim image as the base FROM python:3.10-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 ENV TRANSFORMERS_CACHE=/app/.cache # Set the working directory in the container WORKDIR /app # Copy the requirements file into the container COPY requirements.txt /app/ # Install system dependencies RUN apt-get update && apt-get install -y \ gcc \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache # Install Python dependencies RUN pip install --upgrade pip \ && pip install --no-cache-dir -r requirements.txt # Copy the application code into the container COPY . /app/ # Expose the port Streamlit will run on EXPOSE 7860 # Set Streamlit's configuration to run on all interfaces ENV STREAMLIT_SERVER_ENABLE_CORS=false ENV STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION=false ENV STREAMLIT_SERVER_ENABLEWEBBROWSER=false ENV STREAMLIT_SERVER_PORT=7860 # Run the Streamlit app CMD ["streamlit", "run", "genAI.py", "--server.port=7860"]