feat(Dockerfile): add Dockerfile to containerize the .NET application
chore(Blizzless.csproj): update project configuration to support multiple runtime identifiers for better cross-platform compatibility
This commit is contained in:
parent
9730b68779
commit
a47db464f8
25
Dockerfile
Normal file
25
Dockerfile
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Use the official .NET SDK image to build the application
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the project file and restore dependencies
|
||||||
|
COPY ["src/DiIiS-NA/Blizzless.csproj", "src/DiIiS-NA/"]
|
||||||
|
RUN dotnet restore "src/DiIiS-NA/Blizzless.csproj"
|
||||||
|
|
||||||
|
# Copy the rest of the project files and build the application
|
||||||
|
COPY ["src/", "src/"]
|
||||||
|
WORKDIR "/app/src/DiIiS-NA"
|
||||||
|
RUN dotnet build "Blizzless.csproj" -c Release --runtime linux-x64 -o /app/publish
|
||||||
|
|
||||||
|
# Use the official .NET runtime image to run the application
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the published application from the build stage
|
||||||
|
COPY --from=build /app/publish .
|
||||||
|
|
||||||
|
# Expose the port your application is running on (if needed)
|
||||||
|
EXPOSE 5000
|
||||||
|
|
||||||
|
# Start the application
|
||||||
|
ENTRYPOINT ["./Blizzless"]
|
||||||
@ -11,6 +11,7 @@
|
|||||||
<StartupObject>DiIiS_NA.Program</StartupObject>
|
<StartupObject>DiIiS_NA.Program</StartupObject>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Configurations>Debug;Release;github</Configurations>
|
<Configurations>Debug;Release;github</Configurations>
|
||||||
|
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
Loading…
Reference in New Issue
user.block.title