Added docker support

This commit is contained in:
Steve Smith
2018-05-22 14:23:55 -04:00
parent 7456c26daf
commit 9075221073
10 changed files with 83 additions and 5 deletions

19
src/Web/Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/aspnetcore-build:2.1.300-preview1 AS build
RUN npm install -g bower@1.8.4
WORKDIR /src
COPY . .
WORKDIR /src/src/Web
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish
RUN dotnet publish --no-restore -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Web.dll"]

View File

@@ -119,7 +119,6 @@ namespace Microsoft.eShopWeb
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseBrowserLink();
ListAllRegisteredServices(app);
app.UseDatabaseErrorPage();
}

View File

@@ -9,7 +9,7 @@
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0-rc1-final" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.0-rc1-final" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.0-rc1-final" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.1.0-preview1-final" /> </ItemGroup>
</ItemGroup>
<ItemGroup>
<Folder Include="Views\Catalog\" />
<Folder Include="wwwroot\fonts\" />