File size: 904 Bytes
3bce488 ce3d808 068b3e6 3bce488 068b3e6 3bce488 068b3e6 3bce488 068b3e6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# Build stage
FROM python:3.9-slim as builder
WORKDIR /app
COPY pyproject.toml .
COPY src/ src/
COPY tests/ tests/
# Install dependencies
RUN pip install "numpy<2.0" pandas
RUN pip install --no-cache-dir .
# Runtime stage
FROM python:3.9-slim
WORKDIR /app
# Copy installed packages from builder
COPY --from=builder /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
# Copy application code
COPY src/ src/
COPY tests/ tests/
COPY streamlit_app.py .
# Copy models (CRITICAL for Standalone Mode)
COPY models/ models/
# Create directories for data and reports
RUN mkdir -p data/processed reports && \
chmod -R 777 data models reports
# Expose port (Hugging Face Requirement)
EXPOSE 7860
# Command to run Streamlit
CMD ["streamlit", "run", "streamlit_app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]
|