-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
36 lines (29 loc) · 874 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Stage 1: Build stage
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
# Set the working directory
WORKDIR /src
# Copy the project file and restore the dependencies
COPY *.sln ./
COPY IMS.Presentation/*.csproj ./IMS.Presentation/
COPY IMS.Application/*.csproj ./IMS.Application/
COPY IMS.Core/*.csproj ./IMS.Core/
COPY IMS.Infrastructure/*.csproj ./IMS.Infrastructure/
COPY IMS.Tests/*.csproj ./IMS.Tests/
# Restore the dependencies
RUN dotnet restore
# Copy the remaining files
COPY . .
# Build the project
RUN dotnet build
# Stage 2: Publish stage
FROM build AS publish
WORKDIR /src/IMS.Presentation
RUN dotnet publish -c Release -o /app
# Stage 3: Final stage
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
ENV ASPNETCORE_HTTP_PORTS=5001
EXPOSE 5001
WORKDIR /app
COPY --from=publish /app .
COPY ["web.config", "."]
ENTRYPOINT ["dotnet", "IMS.Presentation.dll"]