-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (31 loc) · 998 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# see: https://hub.docker.com/_/microsoft-dotnet-sdk/
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env
WORKDIR /App
# Copy csproj
COPY *.sln .
COPY Lullaby/*.csproj ./Lullaby/
COPY Lullaby.Database/*.csproj ./Lullaby.Database/
COPY Lullaby.Common/*.csproj ./Lullaby.Common/
COPY Lullaby.Tests/*.csproj ./Lullaby.Tests/
COPY Lullaby.Admin/*.csproj ./Lullaby.Admin/
COPY Lullaby.Jobs/*.csproj ./Lullaby.Jobs/
# Restore as distinct layers
RUN dotnet restore
# Copy everything else
COPY . ./
# Build and publish a release
# main project
WORKDIR /App/Lullaby
RUN dotnet publish -c Release -o out
# admin project
WORKDIR /App/Lullaby.Admin
RUN dotnet publish -c Release -o out
# Build runtime image
# see: https://hub.docker.com/_/microsoft-dotnet-aspnet/
FROM mcr.microsoft.com/dotnet/aspnet:9.0
WORKDIR /App/Lullaby
COPY --from=build-env /App/Lullaby/out .
WORKDIR /App/Lullaby.Admin
COPY --from=build-env /App/Lullaby.Admin/out .
WORKDIR /App/Lullaby
ENTRYPOINT ["dotnet", "Lullaby.dll"]