-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
20 lines (17 loc) · 725 Bytes
/
Copy pathDockerfile
File metadata and controls
20 lines (17 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Use the .NET SDK image to build the project
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app
# Copy csproj files and restore as distinct layers
COPY src/GolfClapBot.Runner/*.csproj ./src/GolfClapBot.Runner/
COPY src/GolfClapBot.Bot/*.csproj ./src/GolfClapBot.Bot/
COPY src/GolfClapBot.Domain/*.csproj ./src/GolfClapBot.Domain/
RUN dotnet restore src/GolfClapBot.Runner/GolfClapBot.Runner.csproj
# Copy everything else and build
COPY src/ ./src/
WORKDIR /app/src/GolfClapBot.Runner
RUN dotnet build -c Release -o out
# Stage 2: Run the application
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build-env /app/src/GolfClapBot.Runner/out .
ENTRYPOINT ["dotnet", "GolfClapBot.Runner.dll"]