Commit
·
1c1ef2c
1
Parent(s):
f9621e5
Update Dockerfile
Browse files- Dockerfile +8 -17
Dockerfile
CHANGED
@@ -1,29 +1,20 @@
|
|
1 |
-
|
2 |
-
FROM python:3.8
|
3 |
|
4 |
-
# Set the working directory
|
5 |
WORKDIR /code
|
6 |
|
7 |
-
# Copy the requirements file
|
8 |
COPY ./requirements.txt /code/requirements.txt
|
9 |
|
10 |
-
# Install requirements
|
11 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
12 |
|
13 |
-
|
14 |
-
RUN pip install transformers
|
15 |
|
16 |
-
|
17 |
-
ARG MODEL_NAME="gyesibiney/Sentiment-review-analysis-roberta-3"
|
18 |
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
-
RUN transformers-cli repo clone git lfs install
|
24 |
-
git clone gyesibiney/Sentiment-review-analysis-roberta-3 --path /code/model
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
1 |
+
FROM python:3.9
|
|
|
2 |
|
|
|
3 |
WORKDIR /code
|
4 |
|
|
|
5 |
COPY ./requirements.txt /code/requirements.txt
|
6 |
|
|
|
7 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
|
9 |
+
RUN useradd -m -u 1000 user
|
|
|
10 |
|
11 |
+
USER user
|
|
|
12 |
|
13 |
+
ENV HOME=/home/user \
|
14 |
+
PATH=/home/user/.local/bin:$PATH
|
15 |
|
16 |
+
WORKDIR $HOME/app
|
|
|
|
|
17 |
|
18 |
+
COPY --chown=user . $HOME/app
|
19 |
|
20 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|