-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 895 Bytes
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 895 Bytes
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
# Build Stage
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
# Export the port
EXPOSE 7700
# Copy project files
COPY Colir.Exceptions/*.csproj Colir.Exceptions/
COPY Colir.DAL/*.csproj Colir.DAL/
COPY Colir.BLL/*.csproj Colir.BLL/
COPY Colir.WebApi/*.csproj Colir.WebApi/
# Restore dependencies
RUN dotnet restore Colir.WebApi/Colir.WebApi.csproj
# Install EF CLI
RUN dotnet tool install --global dotnet-ef --version 6.0.25
ENV PATH="${PATH}:/root/.dotnet/tools"
# Copy remaining files and publish the application
COPY . .
RUN dotnet publish "Colir.WebApi/Colir.WebApi.csproj" -c Release -o /publish
# Runtime Stage
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy AS final
WORKDIR /app
# Copy published output
COPY --from=build /publish .
# Expose application port
ENV ASPNETCORE_HTTP_PORTS=7700
# Entry point for the application
ENTRYPOINT ["dotnet", "Colir.WebApi.dll"]