alethanhson commited on
Commit
44c0f0f
·
1 Parent(s): 84f8f32
Files changed (1) hide show
  1. Dockerfile +7 -4
Dockerfile CHANGED
@@ -15,6 +15,10 @@
15
 
16
  FROM python:3.10-slim
17
 
 
 
 
 
18
  WORKDIR /app
19
 
20
  RUN apt-get update && apt-get install -y \
@@ -24,16 +28,15 @@ RUN apt-get update && apt-get install -y \
24
  gnupg \
25
  && rm -rf /var/lib/apt/lists/*
26
 
27
- COPY requirements.txt .
28
  RUN pip install --no-cache-dir -r requirements.txt
29
 
30
- COPY . .
31
 
32
  ENV PYTHONUNBUFFERED=1
33
  ENV PYTHONIOENCODING=UTF-8
34
 
35
  RUN mkdir -p /root/.cache/huggingface
36
 
37
- EXPOSE 8000
38
-
39
  ENTRYPOINT ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
15
 
16
  FROM python:3.10-slim
17
 
18
+ RUN useradd -m -u 1000 user
19
+ USER user
20
+ ENV PATH="/home/user/.local/bin:$PATH"
21
+
22
  WORKDIR /app
23
 
24
  RUN apt-get update && apt-get install -y \
 
28
  gnupg \
29
  && rm -rf /var/lib/apt/lists/*
30
 
31
+ COPY --chown=user requirements.txt .
32
  RUN pip install --no-cache-dir -r requirements.txt
33
 
34
+ COPY --chown=user . .
35
 
36
  ENV PYTHONUNBUFFERED=1
37
  ENV PYTHONIOENCODING=UTF-8
38
 
39
  RUN mkdir -p /root/.cache/huggingface
40
 
41
+ EXPOSE 7860
 
42
  ENTRYPOINT ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]