From eb91b834c0edb65248073573840fc8c0511a0ce0 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sun, 18 Jun 2023 00:29:46 +0800 Subject: [PATCH] fix: merge docker ENV into one layer (#523) --- Dockerfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 16cee5a7..28510d29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,3 @@ -# https://stackoverflow.com/questions/65612411/forcing-docker-to-use-linux-amd64-platform-by-default-on-macos/69636473#69636473 FROM node:18 # Create app directory @@ -7,13 +6,12 @@ WORKDIR /usr/src/app # Install app dependencies COPY . . -RUN npm config set registry https://registry.npmmirror.com \ - && npm install -g npminstall \ - && npmupdate -c \ +RUN npm install -g npminstall --registry=https://registry.npmmirror.com \ + && npminstall -c \ && npm run tsc -ENV NODE_ENV=production -ENV EGG_SERVER_ENV=prod +ENV NODE_ENV=production \ + EGG_SERVER_ENV=prod EXPOSE 7001 CMD ["npm", "run", "start:foreground"]