File size: 1,087 Bytes
a1a7d89
 
22a3959
 
 
 
 
 
 
 
a1a7d89
 
 
22a3959
a1a7d89
 
 
 
 
 
22a3959
 
 
a1a7d89
22a3959
 
 
a1a7d89
 
22a3959
a1a7d89
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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

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"]