Skip to content

Commit 62273a1

Browse files
authored
Merge pull request #15 from anycode-pk/dev
Dockerfix
2 parents 0d888f1 + 0fcd79c commit 62273a1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1+
# Use the official .NET 8.0 runtime as a base image
2+
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
3+
WORKDIR /app
4+
EXPOSE 80
5+
EXPOSE 443
6+
7+
# Use the official .NET 8.0 SDK as a build image
18
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
29
WORKDIR /src
3-
410
COPY ["TableBooking.Api/TableBooking.Api.csproj", "TableBooking.Api/"]
511
COPY ["TableBooking.Logic/TableBooking.Logic.csproj", "TableBooking.Logic/"]
612
COPY ["TableBooking.Model/TableBooking.Model.csproj", "TableBooking.Model/"]
713
RUN dotnet restore "TableBooking.Api/TableBooking.Api.csproj"
8-
914
COPY . .
1015
WORKDIR "/src/TableBooking.Api"
1116
RUN dotnet build "TableBooking.Api.csproj" -c Release -o /app/build
1217

18+
# Publish the application
1319
FROM build AS publish
1420
RUN dotnet publish "TableBooking.Api.csproj" -c Release -o /app/publish /p:UseAppHost=false
1521

16-
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
22+
# Final stage: use the runtime image
23+
FROM base AS final
1724
WORKDIR /app
1825
COPY --from=publish /app/publish .
19-
EXPOSE 80
20-
EXPOSE 443
2126
ENTRYPOINT ["dotnet", "TableBooking.Api.dll"]

0 commit comments

Comments
 (0)