forked from microsoft/CopilotHackathon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (19 loc) · 778 Bytes
/
Copy pathDockerfile
File metadata and controls
28 lines (19 loc) · 778 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
25
26
27
28
# create dotnet 7 image for the current project
# Use the official .NET 7 SDK image as the base image
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS build
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . .
# Build the project and restore the packages
RUN dotnet restore
# Publish the project to a folder called "out"
RUN dotnet publish -c Release -o out
# Use the official .NET 7 runtime image as the base image
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS runtime
# Set the working directory to /app
WORKDIR /app
# Copy the published output from the build image to the runtime image
COPY --from=build /app/out ./
# Set the entry point to the application
ENTRYPOINT ["dotnet", "/app/MinimalAPI.dll"]