sofzcc commited on
Commit
aedd72e
·
verified ·
1 Parent(s): ac1139c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -6
Dockerfile CHANGED
@@ -1,8 +1,16 @@
1
  FROM python:3.11-slim
2
- WORKDIR /app
3
- COPY requirements.txt .
4
- RUN pip install --no-cache-dir -r requirements.txt
5
- COPY . .
6
- RUN mkdir -p kb .cache/faiss static
 
 
 
 
 
 
 
 
7
  EXPOSE 7860
8
- CMD ["python", "app.py"]
 
1
  FROM python:3.11-slim
2
+
3
+ RUN useradd -m -u 1000 user
4
+ USER user
5
+ ENV HOME=/home/user \
6
+ PATH=/home/user/.local/bin:$PATH
7
+ WORKDIR $HOME/app
8
+
9
+ COPY --chown=user requirements.txt .
10
+ RUN pip install --no-cache-dir --user -r requirements.txt
11
+
12
+ COPY --chown=user . .
13
+ RUN mkdir -p static && mv index.html static/index.html
14
+
15
  EXPOSE 7860
16
+ CMD ["python", "app.py"]