refactor(Dockerfile): 改用 WORKDIR 取代 RUN 內 cd

This commit is contained in:
Jeffery
2026-06-26 14:09:13 +08:00
parent f39f58afb6
commit 21b75caac9
+2 -1
View File
@@ -10,9 +10,10 @@ RUN npm install -g opencode-ai
# 複製 Node.js 應用程式
COPY app/ /app/
WORKDIR /app
# 應用程式無第三方相依套件,僅在有 package-lock 時安裝
RUN if [ -f /app/package-lock.json ]; then cd /app && npm ci --omit=dev; fi
RUN if [ -f package-lock.json ]; then npm ci --omit=dev; fi
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh