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