-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (20 loc) · 732 Bytes
/
Dockerfile
File metadata and controls
23 lines (20 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Copy solution and project files (preserving restore layer caching)
COPY PRPilot.slnx ./
COPY src/PRPilot.API/PRPilot.API.csproj src/PRPilot.API/
COPY src/PRPilot.Core/PRPilot.Core.csproj src/PRPilot.Core/
COPY src/PRPilot.Infrastructure/PRPilot.Infrastructure.csproj src/PRPilot.Infrastructure/
RUN dotnet restore src/PRPilot.API/PRPilot.API.csproj
# Copy the rest of the source
COPY . .
RUN dotnet publish src/PRPilot.API/PRPilot.API.csproj -c Release -o /app
# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app .
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080
USER app
ENTRYPOINT ["dotnet", "PRPilot.API.dll"]