Skip to content

Commit 8c4d92e

Browse files
committed
update Dockerfile
1 parent 567d242 commit 8c4d92e

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/containers/container-tools-react.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -243,38 +243,38 @@ Update the Dockerfile by adding the following lines. This will copy node and npm
243243
:::moniker-end
244244
:::moniker range=">=vs-2022"
245245
```Dockerfile
246-
# escape=`
246+
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
247+
247248
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
248249
#For more information, please see https://aka.ms/containercompat
249-
FROM mcr.microsoft.com/powershell AS downloadnodejs
250+
# escape=`
251+
FROM mcr.microsoft.com/powershell:nanoserver-1809 AS downloadnodejs
250252
ENV NODE_VERSION=14.16.0
251253
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue';"]
252-
RUN Invoke-WebRequest -OutFile nodejs.zip -UseBasicParsing "https://nodejs.org/dist/v$($env:NODE_VERSION)/node-v$($env:NODE_VERSION)-win-x64.zip"; \
253-
Expand-Archive nodejs.zip -DestinationPath C:\; \
254-
Rename-Item "C:\node-v$($env:NODE_VERSION)-win-x64" c:\nodejs
254+
RUN Invoke-WebRequest -OutFile nodejs.zip -UseBasicParsing "https://nodejs.org/dist/v$($env:NODE_VERSION)/node-v$($env:NODE_VERSION)-win-x64.zip"; Expand-Archive nodejs.zip -DestinationPath C:\; Rename-Item "C:\node-v$($env:NODE_VERSION)-win-x64" c:\nodejs
255255

256-
FROM mcr.microsoft.com/dotnet/core/aspnet:6.0 AS base
256+
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
257257
WORKDIR /app
258258
EXPOSE 80
259259
EXPOSE 443
260-
COPY --from=downloadnodejs C:\nodejs\ C:\Windows\system32\
260+
COPY --from=downloadnodejs C:\\nodejs\\ C:\\Windows\\system32\\
261261

262-
FROM mcr.microsoft.com/dotnet/core/sdk:6.0 AS build
263-
COPY --from=downloadnodejs C:\nodejs\ C:\Windows\system32\
262+
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
263+
COPY --from=downloadnodejs C:\\nodejs\\ C:\\Windows\\system32\\
264264
WORKDIR /src
265-
COPY ["WebApplicationReact1/WebApplicationReact1.csproj", "WebApplicationReact1/"]
266-
RUN dotnet restore "WebApplicationReact1/WebApplicationReact1.csproj"
265+
COPY ["Project1-SPA-Windows/Project1-SPA-Windows.csproj", "Project1-SPA-Windows/"]
266+
RUN dotnet restore "Project1-SPA-Windows/Project1-SPA-Windows.csproj"
267267
COPY . .
268-
WORKDIR "/src/WebApplicationReact1"
269-
RUN dotnet build "WebApplicationReact1.csproj" -c Release -o /app/build
268+
WORKDIR "/src/Project1-SPA-Windows"
269+
RUN dotnet build "Project1-SPA-Windows.csproj" -c Release -o /app/build
270270

271271
FROM build AS publish
272-
RUN dotnet publish "WebApplicationReact1.csproj" -c Release -o /app/publish
272+
RUN dotnet publish "Project1-SPA-Windows.csproj" -c Release -o /app/publish /p:UseAppHost=false
273273

274274
FROM base AS final
275275
WORKDIR /app
276276
COPY --from=publish /app/publish .
277-
ENTRYPOINT ["dotnet", "WebApplicationReact1.dll"]
277+
ENTRYPOINT ["dotnet", "Project1-SPA-Windows.dll"]
278278
```
279279

280280
::: moniker-end

0 commit comments

Comments
 (0)