fangbin commited on
Commit
cedbeb8
·
1 Parent(s): 77b790b
Files changed (1) hide show
  1. Dockerfile +6 -2
Dockerfile CHANGED
@@ -32,8 +32,12 @@ ENV LC_ALL=C.UTF-8
32
  ENV MPLCONFIGDIR=/tmp/matplotlib
33
 
34
  # 创建必要的目录并设置权限
35
- RUN mkdir -p /.fonts /.config && \
36
- chmod 777 /.fonts /.config
 
 
 
 
37
 
38
  # 运行应用
39
  CMD ["python", "run.py"]
 
32
  ENV MPLCONFIGDIR=/tmp/matplotlib
33
 
34
  # 创建必要的目录并设置权限
35
+ RUN mkdir -p /.fonts /.config /app/models && \
36
+ chmod -R 777 /.fonts /.config /app/models
37
+
38
+ # 创建非 root 用户
39
+ RUN useradd -m appuser
40
+ USER appuser
41
 
42
  # 运行应用
43
  CMD ["python", "run.py"]