refactor(Dockerfile): 改用 WORKDIR 取代 RUN 內 cd
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user