dragg2 commited on
Commit
f7c1b05
·
verified ·
1 Parent(s): a5b4656

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -2
Dockerfile CHANGED
@@ -1,15 +1,16 @@
1
  FROM verofess/grok2api
2
 
3
- # 临时切换到 root 用户
4
  USER root
5
 
 
 
6
  RUN chown -R pwuser:pwuser /app
7
 
8
  ENV PORT=7860
9
 
10
  EXPOSE 7860
11
 
12
- # 为了安全,切换回将要运行应用的普通用户 pwuser
13
  USER pwuser
14
 
 
15
  CMD ["bash", "-lc", "gunicorn wsgi:app --bind 0.0.0.0:${PORT:-7860} --workers ${WORKERS:-1} --threads ${THREADS:-8} --worker-class gthread --timeout ${TIMEOUT:-180}"]
 
1
  FROM verofess/grok2api
2
 
 
3
  USER root
4
 
5
+ RUN mkdir -p /data && chown -R pwuser:pwuser /data
6
+
7
  RUN chown -R pwuser:pwuser /app
8
 
9
  ENV PORT=7860
10
 
11
  EXPOSE 7860
12
 
 
13
  USER pwuser
14
 
15
+ # 覆盖容器的启动命令,确保 gunicorn 绑定到我们新设置的 $PORT 端口上
16
  CMD ["bash", "-lc", "gunicorn wsgi:app --bind 0.0.0.0:${PORT:-7860} --workers ${WORKERS:-1} --threads ${THREADS:-8} --worker-class gthread --timeout ${TIMEOUT:-180}"]