Spaces:
Runtime error
Runtime error
| # Use Python 3.9 as the base image | |
| FROM python:3.11-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| python3-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create and activate virtual environment | |
| ENV VIRTUAL_ENV=/opt/venv | |
| RUN python3 -m venv $VIRTUAL_ENV | |
| ENV PATH="$VIRTUAL_ENV/bin:$PATH" | |
| # Copy requirements first to leverage Docker cache | |
| COPY requirements.txt /app/requirements.txt | |
| # Install dependencies in virtual environment | |
| RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt | |
| # Copy the rest of the application | |
| COPY . . | |
| ENV PYTHONPATH=/app | |
| ENV PYTHONUNBUFFERED=1 | |
| # Expose the default Chainlit port | |
| EXPOSE 8000 | |
| # Command to run the application | |
| # CMD . /opt/venv/bin/activate && exec chainlit run app.py --port 8000 | |
| CMD ["chainlit", "run", "app.py", "--port", "7860"] |