-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (18 loc) · 783 Bytes
/
Dockerfile
File metadata and controls
24 lines (18 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Stage 1: Compile and publish the source code
FROM microsoft/dotnet:2.1.300-sdk AS builder
WORKDIR /app
COPY *.sln ./
COPY BlazorShop.Client ./BlazorShop.Client
COPY BlazorShop.Server ./BlazorShop.Server
COPY BlazorShop.Shared ./BlazorShop.Shared
COPY global.json global.json
COPY NuGet.Config NuGet.Config
## restore onto a separate layer. That way, we have a single
RUN dotnet restore --configfile NuGet.Config
RUN dotnet publish --configuration Release --no-restore --output /app/out /p:PublishWithAspNetCoreTargetManifest="false"
# Stage 2: Copies the published code out to published image
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
WORKDIR /app
ENV ASPNETCORE_URLS http://+:5000
COPY --from=builder /app/out .
ENTRYPOINT ["dotnet", "BlazorShop.Server.dll"]