-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.api
More file actions
32 lines (24 loc) · 939 Bytes
/
Dockerfile.api
File metadata and controls
32 lines (24 loc) · 939 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
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app
EXPOSE 5000
ENV ASPNETCORE_URLS=http://+:5000
ENV ASPNETCORE_ENVIRONMENT=Development
USER app
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG configuration=Release
WORKDIR /src
# Instalar certificados raíz
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && update-ca-certificates
COPY ["source/api/Risk.API/Risk.API.csproj", "Risk.API/"]
COPY ["source/api/Risk.Common/Risk.Common.csproj", "Risk.Common/"]
RUN dotnet restore "Risk.API/Risk.API.csproj"
COPY ./source/api .
WORKDIR "/src/Risk.API"
RUN dotnet build "Risk.API.csproj" -c $configuration -o /app/build
FROM build AS publish
ARG configuration=Release
RUN dotnet publish "Risk.API.csproj" -c $configuration -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Risk.API.dll"]