File tree 5 files changed +37
-17
lines changed
src/Azure.Functions.Cli/StaticResources
5 files changed +37
-17
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ FROM mcr.microsoft.com/azure-functions/node:4-node14
5
5
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
6
6
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
7
7
8
- COPY . /home/site/wwwroot
8
+ WORKDIR /home/site/wwwroot
9
9
10
- RUN cd /home/site/wwwroot && \
11
- npm install
10
+ # Copy package.json and install packages before copying the rest of the code to enable caching
11
+ COPY package.json package.json
12
+ RUN npm install
13
+
14
+ # Copy the rest of the code
15
+ COPY . .
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ FROM mcr.microsoft.com/azure-functions/node:4-node16
5
5
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
6
6
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
7
7
8
- COPY . /home/site/wwwroot
8
+ WORKDIR /home/site/wwwroot
9
9
10
- RUN cd /home/site/wwwroot && \
11
- npm install
10
+ # Copy package.json and install packages before copying the rest of the code to enable caching
11
+ COPY package.json package.json
12
+ RUN npm install
13
+
14
+ # Copy the rest of the code
15
+ COPY . .
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ FROM mcr.microsoft.com/azure-functions/node:4-node18
5
5
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
6
6
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
7
7
8
- COPY . /home/site/wwwroot
8
+ WORKDIR /home/site/wwwroot
9
9
10
- RUN cd /home/site/wwwroot && \
11
- npm install
10
+ # Copy package.json and install packages before copying the rest of the code to enable caching
11
+ COPY package.json package.json
12
+ RUN npm install
13
+
14
+ # Copy the rest of the code
15
+ COPY . .
Original file line number Diff line number Diff line change @@ -5,8 +5,12 @@ FROM mcr.microsoft.com/azure-functions/node:4-node16
5
5
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
6
6
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
7
7
8
- COPY . /home/site/wwwroot
8
+ WORKDIR /home/site/wwwroot
9
9
10
- RUN cd /home/site/wwwroot && \
11
- npm install && \
12
- npm run build
10
+ # Copy package.json and install packages before copying the rest of the code to enable caching
11
+ COPY package.json package.json
12
+ RUN npm install
13
+
14
+ # Copy the rest of the code
15
+ COPY . .
16
+ RUN npm run build
Original file line number Diff line number Diff line change @@ -5,8 +5,12 @@ FROM mcr.microsoft.com/azure-functions/node:4-node18
5
5
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
6
6
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
7
7
8
- COPY . /home/site/wwwroot
8
+ WORKDIR /home/site/wwwroot
9
9
10
- RUN cd /home/site/wwwroot && \
11
- npm install && \
12
- npm run build
10
+ # Copy package.json and install packages before copying the rest of the code to enable caching
11
+ COPY package.json package.json
12
+ RUN npm install
13
+
14
+ # Copy the rest of the code
15
+ COPY . .
16
+ RUN npm run build
You can’t perform that action at this time.
0 commit comments