molinari135
commited on
Commit
•
22a3959
1
Parent(s):
cd872e1
Update Dockerfile
Browse files- Dockerfile +16 -9
Dockerfile
CHANGED
@@ -1,29 +1,36 @@
|
|
1 |
FROM python:3.12-slim
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
RUN python -m pip install --upgrade pip==23.3.1
|
7 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
8 |
build-essential && \
|
9 |
rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
-
COPY product_return_prediction $WORKDIR/product_return_prediction
|
12 |
|
13 |
# COPY product_return_prediction/api.py $WORKDIR/product_return_prediction
|
14 |
# COPY product_return_prediction/config.py $WORKDIR/product_return_prediction
|
15 |
# COPY product_return_prediction/dataset.py $WORKDIR/product_return_prediction
|
16 |
# COPY product_return_prediction/features.py $WORKDIR/product_return_prediction
|
17 |
|
18 |
-
COPY README.md $WORKDIR/
|
19 |
-
COPY requirements.txt $WORKDIR/
|
20 |
-
COPY pyproject.toml $WORKDIR/
|
21 |
|
22 |
-
COPY data/external/inventory.tsv $WORKDIR/data/external/
|
23 |
-
COPY models/scaler.pkl $WORKDIR/models/
|
24 |
-
COPY models/svm.pkl $WORKDIR/models/
|
25 |
|
26 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
27 |
# RUN pip install --no-cache-dir .
|
28 |
|
29 |
EXPOSE 7860
|
|
|
1 |
FROM python:3.12-slim
|
2 |
|
3 |
+
RUN useradd -m -u 1000 user
|
4 |
+
|
5 |
+
USER user
|
6 |
+
|
7 |
+
ENV HOME=/home/user \
|
8 |
+
PATH=/home/user/.local/bin:$PATH
|
9 |
+
|
10 |
+
WORKDIR $HOME/app
|
11 |
|
12 |
RUN python -m pip install --upgrade pip==23.3.1
|
13 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
14 |
build-essential && \
|
15 |
rm -rf /var/lib/apt/lists/*
|
16 |
|
17 |
+
COPY --chown=user product_return_prediction $WORKDIR/product_return_prediction
|
18 |
|
19 |
# COPY product_return_prediction/api.py $WORKDIR/product_return_prediction
|
20 |
# COPY product_return_prediction/config.py $WORKDIR/product_return_prediction
|
21 |
# COPY product_return_prediction/dataset.py $WORKDIR/product_return_prediction
|
22 |
# COPY product_return_prediction/features.py $WORKDIR/product_return_prediction
|
23 |
|
24 |
+
COPY --chown=user README.md $WORKDIR/
|
25 |
+
COPY --chown=user requirements.txt $WORKDIR/
|
26 |
+
COPY --chown=user pyproject.toml $WORKDIR/
|
27 |
|
28 |
+
COPY --chown=user data/external/inventory.tsv $WORKDIR/data/external/
|
29 |
+
COPY --chown=user models/scaler.pkl $WORKDIR/models/
|
30 |
+
COPY --chown=user models/svm.pkl $WORKDIR/models/
|
31 |
|
32 |
RUN pip install --no-cache-dir -r requirements.txt
|
33 |
+
|
34 |
# RUN pip install --no-cache-dir .
|
35 |
|
36 |
EXPOSE 7860
|