scoring / Dockerfile
Kartikeyssj2's picture
Update Dockerfile
c033def verified
raw
history blame
731 Bytes
# BASE IMAGE
FROM python:3.12.3-slim
# SET WORKING DIRECTORY
WORKDIR /app
# COPY REQUIREMENTS FILE
COPY requirements.txt .
# INSTALL SYSTEM DEPENDENCIES AND UPGRADE PIP
RUN apt-get update \
&& apt-get install -y git build-essential libffi-dev libssl-dev python3-dev \
&& pip install --upgrade pip \
&& pip install -r requirements.txt \
&& apt-get clean
# COPY ALL CONTENTS OF THE CURRENT DIRECTORY
COPY . .
# RUN THE PYTHON SCRIPT TO DOWNLOAD NECESSARY MODELS AND FILES
RUN python download_models.py
# USE 4 WORKER PROCESSES AND ENABLE LOGGING TO STDOUT
CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "fast_api:app", "--log-level", "info", "--access-logfile", "-", "--error-logfile", "-"]