Spaces:
Runtime error
Runtime error
FROM python:3.10-slim | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/* | |
# Copy requirements and install Python dependencies | |
COPY requirements.txt /app/requirements.txt | |
RUN pip install --no-cache-dir -r /app/requirements.txt | |
# Copy training script and application code | |
WORKDIR /app | |
COPY train_model.py /app/train_model.py | |
COPY app.py /app/app.py | |
# ------------------------------------------------------------ | |
# Train the model during the Docker build phase (creates model.pkl) | |
# ------------------------------------------------------------ | |
RUN python train_model.py | |
# Expose Streamlit port | |
EXPOSE 7860 | |
# Start the Streamlit app | |
CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"] | |