alethanhson commited on
Commit
5825e0c
·
1 Parent(s): 44c0f0f
Files changed (1) hide show
  1. Dockerfile +11 -11
Dockerfile CHANGED
@@ -15,12 +15,7 @@
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 \
25
  git \
26
  ffmpeg \
@@ -28,15 +23,20 @@ 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"]
 
15
 
16
  FROM python:3.10-slim
17
 
18
+ # Install system dependencies as root
 
 
 
 
 
19
  RUN apt-get update && apt-get install -y \
20
  git \
21
  ffmpeg \
 
23
  gnupg \
24
  && rm -rf /var/lib/apt/lists/*
25
 
26
+ # Create directories that will be needed later
27
+ RUN mkdir -p /home/user/.cache/huggingface
28
 
29
+ RUN useradd -m -u 1000 user
30
+ USER user
31
+ ENV PATH="/home/user/.local/bin:$PATH"
32
+
33
+ WORKDIR /app
34
 
35
+ COPY --chown=user . .
36
  ENV PYTHONUNBUFFERED=1
37
  ENV PYTHONIOENCODING=UTF-8
38
 
 
 
39
  EXPOSE 7860
40
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
41
+
42
  ENTRYPOINT ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]