diff --git a/Dockerfile b/Dockerfile index d5801d5..04b5cd7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # sudo docker build -t guesswhoiams . -# # sudo docker exec -it 51bd6c84a7f2 /bin/bash +# sudo docker exec -it 5cac9af04256 /bin/bash FROM node:19.4.0 @@ -16,20 +16,21 @@ ADD . /src RUN npm run build # clean -RUN npm prune --production +RUN npm prune --prod # move RUN rm -rf /app \ && mv dist /app \ + && mv .env /app \ && mv node_modules /app/ \ && rm -rf /src # ENV -ENV NODE_ENV production +ENV NODE_ENV prod EXPOSE 3003 WORKDIR /app # 指定啟動container後執行命令 -CMD node index.js +CMD NODE_ENV=prod && node index.js # CMD [ "npm", "start" ] \ No newline at end of file