tanbushi commited on
Commit
f7728bf
·
1 Parent(s): fff456b
Files changed (1) hide show
  1. Dockerfile +4 -1
Dockerfile CHANGED
@@ -28,12 +28,15 @@ RUN if [ -f package.json ]; then npm ci --only=production; fi
28
  RUN chown -R opencode:opencode /app /home/opencode
29
 
30
  # ---------- 8. 启动脚本 ----------
31
- USER opencode
32
  RUN mkdir -p /home/opencode/.local/bin
33
  RUN printf '#!/bin/sh\n\
34
  echo "Starting OpenCode AI Web Server ..."\n\
 
 
35
  exec /usr/local/bin/opencode serve --hostname 0.0.0.0 --port 7860\n' > /home/opencode/.local/bin/start.sh && \
36
  chmod +x /home/opencode/.local/bin/start.sh
 
37
 
38
  # ---------- 9. 端口与健康检查 ----------
39
  EXPOSE 7860
 
28
  RUN chown -R opencode:opencode /app /home/opencode
29
 
30
  # ---------- 8. 启动脚本 ----------
31
+ USER root
32
  RUN mkdir -p /home/opencode/.local/bin
33
  RUN printf '#!/bin/sh\n\
34
  echo "Starting OpenCode AI Web Server ..."\n\
35
+ # 启动 cron 服务\n\
36
+ service cron start\n\
37
  exec /usr/local/bin/opencode serve --hostname 0.0.0.0 --port 7860\n' > /home/opencode/.local/bin/start.sh && \
38
  chmod +x /home/opencode/.local/bin/start.sh
39
+ USER opencode
40
 
41
  # ---------- 9. 端口与健康检查 ----------
42
  EXPOSE 7860