-
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
0bdaf75
commit 0ed175e
Showing
1 changed file
with
26 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,26 @@ | ||
# Use the official ASP.NET runtime image as a base image | ||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
|
||
# Use the SDK image to build the application | ||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build | ||
WORKDIR /src | ||
|
||
# Copy the .csproj file and restore dependencies | ||
COPY ["MusicService/MusicService.csproj", "MusicService/"] | ||
RUN dotnet restore "MusicService/MusicService.csproj" | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
WORKDIR "/src/MusicService" | ||
RUN dotnet build "MusicService.csproj" -c Release -o /app/build | ||
|
||
FROM build AS publish | ||
RUN dotnet publish "MusicService.csproj" -c Release -o /app/publish | ||
|
||
# Use the base image to run the application | ||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "MusicService.dll"] |