-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMunsonPickles.API.Dockerfile
More file actions
22 lines (19 loc) · 921 Bytes
/
MunsonPickles.API.Dockerfile
File metadata and controls
22 lines (19 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# https://hub.docker.com/_/microsoft-dotnet
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
WORKDIR /source
# copy csproj files of app and libraries, and restore as distinct layers
COPY "MunsonPickles.API/*.csproj" "MunsonPickles.API/"
COPY "MunsonPickles.Shared/*.csproj" "MunsonPickles.Shared/"
RUN dotnet restore "MunsonPickles.API/MunsonPickles.API.csproj"
# copy and build app and libraries
COPY "MunsonPickles.API/" "MunsonPickles.API/"
COPY "MunsonPickles.Shared/" "MunsonPickles.Shared/"
WORKDIR "/source/MunsonPickles.API"
# Currently it doesn't work with --no-restore flag so I've removed it. I plan to use it in the future.
# I opened this issue in Github for this: https://github.com/dotnet/sdk/issues/37291
RUN dotnet publish -o /app
# final stage/image
FROM mcr.microsoft.com/dotnet/nightly/aspnet:8.0-jammy-chiseled-composite
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["./MunsonPickles.API"]