|
FROM python:3.12-slim |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
USER root |
|
|
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
|
|
WORKDIR /home/user/app |
|
|
|
|
|
RUN pip install --no-cache-dir --upgrade pip==23.3.1 |
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
build-essential && \ |
|
rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
USER user |
|
|
|
|
|
COPY --chown=user product_return_prediction $HOME/app/product_return_prediction |
|
COPY --chown=user README.md $HOME/app/ |
|
COPY --chown=user requirements.txt $HOME/app/ |
|
COPY --chown=user pyproject.toml $HOME/app/ |
|
|
|
|
|
COPY --chown=user models/scaler.pkl $HOME/app/models/ |
|
COPY --chown=user models/svm.pkl $HOME/app/models/ |
|
|
|
|
|
RUN pip install --no-cache-dir -r $HOME/app/requirements.txt |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["uvicorn", "product_return_prediction.api:app", "--host", "0.0.0.0", "--port", "7860", "--reload"] |
|
|