arronlx commited on
Commit
67e0054
·
verified ·
1 Parent(s): 1c2c5bd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -0
Dockerfile CHANGED
@@ -8,6 +8,8 @@ RUN apk add --no-cache curl
8
 
9
  ARG CONFIG_URL
10
 
 
 
11
 
12
  # 下载并替换配置文件,使用 CONFIG_URL 变量
13
  RUN if [ -n "$CONFIG_URL" ]; then \
@@ -19,5 +21,7 @@ RUN if [ -n "$CONFIG_URL" ]; then \
19
  # 确保文件权限正确
20
  RUN chown nextjs:nodejs /app/config.json
21
 
 
 
22
  # 切换回非特权用户
23
  USER nextjs
 
8
 
9
  ARG CONFIG_URL
10
 
11
+ # 备份或删除原配置文件
12
+ RUN if [ -f /app/config.json ]; then mv /app/config.json /app/config.json.bak; fi
13
 
14
  # 下载并替换配置文件,使用 CONFIG_URL 变量
15
  RUN if [ -n "$CONFIG_URL" ]; then \
 
21
  # 确保文件权限正确
22
  RUN chown nextjs:nodejs /app/config.json
23
 
24
+ RUN ls -l /app
25
+
26
  # 切换回非特权用户
27
  USER nextjs