FROM python:3.11-slim | |
# Set environment variables | |
ENV DEBIAN_FRONTEND=noninteractive | |
ENV TZ=UTC | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
build-essential \ | |
libsqlite3-dev \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Set working directory | |
WORKDIR /app | |
# Install Python dependencies | |
RUN pip install --no-cache-dir --upgrade pip setuptools && \ | |
pip install --no-cache-dir \ | |
fastapi==0.113.0 \ | |
pymongo==4.9.1 \ | |
pandas==2.2.3 \ | |
numpy==1.26.4 \ | |
scikit-learn==1.5.2 \ | |
joblib==1.4.2 \ | |
uvicorn==0.30.6 | |
# Copy your application files | |
COPY . . | |
# Expose the port | |
EXPOSE 7860 | |
# Command to run your application | |
CMD ["python", "app.py"] | |