Skip to content

Commit 623c085

Browse files
authored
Updating the docker files. (#3359)
1 parent f032367 commit 623c085

File tree

7 files changed

+35
-8
lines changed

7 files changed

+35
-8
lines changed

src/Azure.Functions.Cli/Actions/LocalActions/InitAction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,11 @@ private static async Task WriteDockerfile(WorkerRuntime workerRuntime, string la
398398
{
399399
if (language == Constants.Languages.TypeScript)
400400
{
401-
await FileSystemHelpers.WriteFileIfNotExists("Dockerfile", await StaticResources.DockerfileTypescript);
401+
await FileSystemHelpers.WriteFileIfNotExists("Dockerfile", await StaticResources.DockerfileTypescriptNode18);
402402
}
403403
else
404404
{
405-
await FileSystemHelpers.WriteFileIfNotExists("Dockerfile", await StaticResources.DockerfileNode16);
405+
await FileSystemHelpers.WriteFileIfNotExists("Dockerfile", await StaticResources.DockerfileNode18);
406406
}
407407
}
408408
else if (workerRuntime == Helpers.WorkerRuntime.python)

src/Azure.Functions.Cli/Azure.Functions.Cli.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@
100100
<EmbeddedResource Include="StaticResources\Dockerfile.typescript">
101101
<LogicalName>$(AssemblyName).Dockerfile.typescript</LogicalName>
102102
</EmbeddedResource>
103+
<EmbeddedResource Include="StaticResources\Dockerfile.node18">
104+
<LogicalName>$(AssemblyName).Dockerfile.node18</LogicalName>
105+
</EmbeddedResource>
106+
<EmbeddedResource Include="StaticResources\Dockerfile.typescript.node18">
107+
<LogicalName>$(AssemblyName).Dockerfile.typescript.node18</LogicalName>
108+
</EmbeddedResource>
103109
<EmbeddedResource Include="StaticResources\gitignore">
104110
<LogicalName>$(AssemblyName).gitignore</LogicalName>
105111
</EmbeddedResource>

src/Azure.Functions.Cli/StaticResources/Dockerfile.dotnet

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS installer-env
22

3-
# Build requires 3.1 SDK
4-
COPY --from=mcr.microsoft.com/dotnet/core/sdk:3.1 /usr/share/dotnet /usr/share/dotnet
5-
63
COPY . /src/dotnet-function-app
74
RUN cd /src/dotnet-function-app && \
85
mkdir -p /home/site/wwwroot && \

src/Azure.Functions.Cli/StaticResources/Dockerfile.dotnetIsolated

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS installer-env
22

3-
# Build requires 3.1 SDK
4-
COPY --from=mcr.microsoft.com/dotnet/core/sdk:3.1 /usr/share/dotnet /usr/share/dotnet
5-
63
COPY . /src/dotnet-function-app
74
RUN cd /src/dotnet-function-app && \
85
mkdir -p /home/site/wwwroot && \
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To enable ssh & remote debugging on app service change the base image to the one below
2+
# FROM mcr.microsoft.com/azure-functions/node:4-node18-appservice
3+
FROM mcr.microsoft.com/azure-functions/node:4-node18
4+
5+
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
6+
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
7+
8+
COPY . /home/site/wwwroot
9+
10+
RUN cd /home/site/wwwroot && \
11+
npm install
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# To enable ssh & remote debugging on app service change the base image to the one below
2+
# FROM mcr.microsoft.com/azure-functions/node:4-node18-appservice
3+
FROM mcr.microsoft.com/azure-functions/node:4-node18
4+
5+
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
6+
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
7+
8+
COPY . /home/site/wwwroot
9+
10+
RUN cd /home/site/wwwroot && \
11+
npm install && \
12+
npm run build

src/Azure.Functions.Cli/StaticResources/StaticResources.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ public static async Task<string> GetValue(string name)
5858

5959
public static Task<string> DockerfileNode16 => GetValue("Dockerfile.node16");
6060

61+
public static Task<string> DockerfileNode18 => GetValue("Dockerfile.node18");
62+
6163
public static Task<string> DockerfileTypescript => GetValue("Dockerfile.typescript");
6264

65+
public static Task<string> DockerfileTypescriptNode18 => GetValue("Dockerfile.typescript.node18");
66+
6367
public static Task<string> DockerIgnoreFile => GetValue("dockerignore");
6468

6569
public static Task<string> VsCodeExtensionsJson => GetValue("vscode.extensions.json");

0 commit comments

Comments
 (0)