modelLoanStatusCode / Dockerfile
agentsay's picture
Update Dockerfile
278040b verified
raw
history blame
800 Bytes
# Use an official Python runtime as a parent image
FROM python:3.9-slim
USER root
# Set working directory in the container
WORKDIR /app
# Copy the FastAPI application file
COPY modelLoanAPI.py /app/modelLoanAPI.py
# Copy requirements file (created below)
COPY requirements.txt /app/requirements.txt
COPY requirements.txt /app/extended_worker_dataset.csv
# Install system dependencies required for matplotlib and other libraries
RUN apt-get update && apt-get install -y \
gcc \
python3-dev \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Expose the port the app runs on
EXPOSE 7860
# Command to run the FastAPI application
CMD ["uvicorn", "modelLoanAPI:app", "--host", "0.0.0.0", "--port", "7860"]