@@ -5,7 +5,7 @@ ms.custom: SEO-VS-2020
5
5
author : ghogen
6
6
description : Learn how to create a containerized React SPA app with Visual Studio Container Tools and Docker
7
7
ms.author : ghogen
8
- ms.date : 10 /25/2021
8
+ ms.date : 08 /25/2022
9
9
ms.technology : vs-container-tools
10
10
ms.topic : quickstart
11
11
---
@@ -40,7 +40,6 @@ For Docker installation, first review the information at [Docker Desktop for Win
40
40
41
41
## Create a project and add Docker support
42
42
43
-
44
43
::: moniker range="vs-2019"
45
44
46
45
1 . Create a new project using the ** ASP.NET Core with React.js** template.
@@ -114,19 +113,19 @@ RUN apt-get install -y libpng-dev libjpeg-dev curl libxi6 build-essential libgl1
114
113
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
115
114
RUN apt-get install -y nodejs
116
115
WORKDIR /src
117
- COPY ["ReactSPA/ReactSPA .csproj" , "ReactSPA /" ]
118
- RUN dotnet restore "ReactSPA/ReactSPA .csproj"
116
+ COPY ["ProjectSPA1/ProjectSPA1 .csproj" , "ProjectSPA1 /" ]
117
+ RUN dotnet restore "ProjectSPA1/ProjectSPA1 .csproj"
119
118
COPY . .
120
- WORKDIR "/src/ReactSPA "
121
- RUN dotnet build "ReactSPA .csproj" -c Release -o /app/build
119
+ WORKDIR "/src/ProjectSPA1 "
120
+ RUN dotnet build "ProjectSPA1 .csproj" -c Release -o /app/build
122
121
123
122
FROM build AS publish
124
- RUN dotnet publish "ReactSPA .csproj" -c Release -o /app/publish
123
+ RUN dotnet publish "ProjectSPA1 .csproj" -c Release -o /app/publish
125
124
126
125
FROM base AS final
127
126
WORKDIR /app
128
127
COPY --from=publish /app/publish .
129
- ENTRYPOINT ["dotnet" , "ReactSPA .dll" ]
128
+ ENTRYPOINT ["dotnet" , "ProjectSPA1 .dll" ]
130
129
```
131
130
132
131
::: moniker-end
@@ -152,19 +151,19 @@ RUN apt-get install -y libpng-dev libjpeg-dev curl libxi6 build-essential libgl1
152
151
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
153
152
RUN apt-get install -y nodejs
154
153
WORKDIR /src
155
- COPY ["ReactSPA/ReactSPA .csproj" , "ReactSPA /" ]
156
- RUN dotnet restore "ReactSPA/ReactSPA .csproj"
154
+ COPY ["ProjectSPA1/ProjectSPA1 .csproj" , "ProjectSPA1 /" ]
155
+ RUN dotnet restore "ProjectSPA1/ProjectSPA1 .csproj"
157
156
COPY . .
158
- WORKDIR "/src/ReactSPA "
159
- RUN dotnet build "ReactSPA .csproj" -c Release -o /app/build
157
+ WORKDIR "/src/ProjectSPA1 "
158
+ RUN dotnet build "ProjectSPA1 .csproj" -c Release -o /app/build
160
159
161
160
FROM build AS publish
162
- RUN dotnet publish "ReactSPA .csproj" -c Release -o /app/publish
161
+ RUN dotnet publish "ProjectSPA1 .csproj" -c Release -o /app/publish
163
162
164
163
FROM base AS final
165
164
WORKDIR /app
166
165
COPY --from=publish /app/publish .
167
- ENTRYPOINT ["dotnet" , "ReactSPA .dll" ]
166
+ ENTRYPOINT ["dotnet" , "ProjectSPA1 .dll" ]
168
167
```
169
168
170
169
::: moniker-end
@@ -225,19 +224,19 @@ Update the Dockerfile by adding the following lines. This will copy node and npm
225
224
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
226
225
COPY --from=downloadnodejs C:\n odejs\ C:\W indows\s ystem32\
227
226
WORKDIR /src
228
- COPY ["WebApplicationReact1/WebApplicationReact1 .csproj" , "WebApplicationReact1 /" ]
229
- RUN dotnet restore "WebApplicationReact1/WebApplicationReact1 .csproj"
227
+ COPY ["ProjectSPA1/ProjectSPA1 .csproj" , "ProjectSPA1 /" ]
228
+ RUN dotnet restore "ProjectSPA1/ProjectSPA1 .csproj"
230
229
COPY . .
231
- WORKDIR "/src/WebApplicationReact1 "
232
- RUN dotnet build "WebApplicationReact1 .csproj" -c Release -o /app/build
230
+ WORKDIR "/src/ProjectSPA1 "
231
+ RUN dotnet build "ProjectSPA1 .csproj" -c Release -o /app/build
233
232
234
233
FROM build AS publish
235
- RUN dotnet publish "WebApplicationReact1 .csproj" -c Release -o /app/publish
234
+ RUN dotnet publish "ProjectSPA1 .csproj" -c Release -o /app/publish
236
235
237
236
FROM base AS final
238
237
WORKDIR /app
239
238
COPY --from=publish /app/publish .
240
- ENTRYPOINT ["dotnet" , "WebApplicationReact1 .dll" ]
239
+ ENTRYPOINT ["dotnet" , "ProjectSPA1 .dll" ]
241
240
```
242
241
243
242
:::moniker-end
@@ -402,7 +401,6 @@ You can also view the images and inspect information about them. Choose the **Im
402
401
403
402
Once the develop and debug cycle of the app is completed, you can create a production image of the app.
404
403
405
-
406
404
:::moniker range="vs-2019"
407
405
408
406
1 . Change the configuration drop-down to ** Release** and build the app.
0 commit comments