more fixes to `Dockerfile`

This commit is contained in:
Alan Moon 2024-11-28 10:55:17 -08:00
parent 17cd6a2059
commit d73fd78472

View File

@ -1,17 +1,18 @@
# Use the official .NET SDK image for building the application
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:6.0
WORKDIR /src
# Copy the source code
COPY . .
# Restore dependencies and build the application
# Restore Project
RUN dotnet build -c Release -o /app
# Create clean run environment (without source and sdk)
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
COPY --from=build /app .
# FROM mcr.microsoft.com/dotnet/aspnet:6.0
# WORKDIR /app
# COPY --from=build /app .
# Run the application
WORKDIR /app
ENTRYPOINT ["./sodoffmmo"]