nvd commited on
Commit
baa410d
·
verified ·
1 Parent(s): e8cb213

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -5
Dockerfile CHANGED
@@ -1,6 +1,18 @@
1
  FROM python:3.9
2
- WORKDIR /code
3
- COPY ./requirements.txt /code/requirements.txt
4
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
5
- COPY . .
6
- CMD ["python", "main.py"]
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM python:3.9
2
+
3
+ # Set up a new user to avoid permission issues with the .session file
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV PATH="/home/user/.local/bin:$PATH"
7
+
8
+ WORKDIR /home/user/app
9
+
10
+ # Install dependencies
11
+ COPY --chown=user requirements.txt .
12
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
+
14
+ # Copy the rest of the files
15
+ COPY --chown=user . .
16
+
17
+ # Hugging Face runs on port 7860
18
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]