gyesibiney commited on
Commit
1c1ef2c
·
1 Parent(s): f9621e5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -17
Dockerfile CHANGED
@@ -1,29 +1,20 @@
1
- # Use a base image
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
- # Install transformers library
14
- RUN pip install transformers
15
 
16
- # Specify the model name from Hugging Face
17
- ARG MODEL_NAME="gyesibiney/Sentiment-review-analysis-roberta-3"
18
 
19
- # Download the model from Hugging Face (you can replace 'main' with a specific tag or version)
20
- RUN transformers-cli login
21
 
22
- # Clone the model repository
23
- RUN transformers-cli repo clone git lfs install
24
- git clone gyesibiney/Sentiment-review-analysis-roberta-3 --path /code/model
25
 
26
- # Add your application code here to use the downloaded model
27
 
28
- # Example: Run your FastAPI application
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"]