-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f59890a
commit 49ebcc1
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Use the official .NET SDK image for building the solution | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
|
||
# Set the working directory | ||
WORKDIR /src | ||
|
||
# Copy the solution and all projects into the container | ||
COPY ["demoMvcCore.sln", "./"] | ||
COPY ["/CoreBusiness.csproj", "CoreBusiness/"] | ||
COPY ["/demoMvcCore.csproj","demoMvcCore/"] | ||
COPY ["/UseCases.csproj", "UseCases/"] | ||
COPY ["Plugins.DataStore.SQL/Plugins.DataStore.SQL.csproj", "Plugins.DataStore,SQL/"] | ||
|
||
# Restore dependencies for all projects in the solution | ||
RUN dotnet restore demoMvcCore.sln | ||
|
||
# Copy all source files into the container | ||
COPY . . | ||
|
||
# Build the solution in Release mode | ||
RUN dotnet build demoMvcCore.sln --configuration Release --no-restore | ||
|
||
# Publish the Web API project (the entry point) | ||
FROM build AS publish | ||
RUN dotnet publish demoMvcCore/demoMvcCore.csproj --configuration Release --output /app/publish --no-build | ||
|
||
# Use the .NET runtime image to run the app | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the published output from the build container | ||
COPY --from=publish /app/publish . | ||
|
||
# Expose the port the app will run on | ||
EXPOSE 80 | ||
|
||
# Set the entry point to start the Web API application | ||
ENTRYPOINT ["dotnet", "demoMvcCore.dll"] |