From 343273374d4fdf118f334b108f31fb1eaac36fa0 Mon Sep 17 00:00:00 2001 From: Tiago Alves Macambira Date: Wed, 21 Jun 2023 21:13:42 -0700 Subject: [PATCH] Fix Dockerfile for Azure Container Registry builds As commented in #3 by @horihiro: > According to the implementation of vscode-docker, it seems that the > Build image in Azure command uses the root of the workspace as a root > directory for container-building even if Dockerfile is in a > sub-directry. This commit moves the Dockerfile to the root of the repository. This file was updated to reflect this move, removed duplicate work from `COPY` commands and ensure the same file work consistently for both local builds and for Azure Container Registry builds. Fixes #3 Also addresses MicrosoftDocs/azure-docs#101118 Signed-off-by: Tiago Alves Macambira --- src/.dockerignore => .dockerignore | 0 src/Dockerfile => Dockerfile | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) rename src/.dockerignore => .dockerignore (100%) rename src/Dockerfile => Dockerfile (68%) diff --git a/src/.dockerignore b/.dockerignore similarity index 100% rename from src/.dockerignore rename to .dockerignore diff --git a/src/Dockerfile b/Dockerfile similarity index 68% rename from src/Dockerfile rename to Dockerfile index 5b2539e..b35dbd4 100644 --- a/src/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ FROM node:lts-alpine ENV NODE_ENV=production WORKDIR /usr/src/app -COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"] +COPY src/ . RUN npm install --production --silent && mv node_modules ../ -COPY . . EXPOSE 3500 RUN chown -R node /usr/src/app USER node