-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (23 loc) · 848 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (23 loc) · 848 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
# Estágio de build
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Copiar arquivos de projeto e restaurar dependências
COPY ["SGF.API/SGF.API.csproj", "SGF.API/"]
COPY ["Application/Application.csproj", "Application/"]
COPY ["Domain/Domain.csproj", "Domain/"]
COPY ["Infrastructure/Infrastructure.csproj", "Infrastructure/"]
RUN dotnet restore "SGF.API/SGF.API.csproj"
# Copiar todo o código fonte e fazer o build
COPY . .
WORKDIR "/src/SGF.API"
RUN dotnet build "SGF.API.csproj" -c Release -o /app/build
# Estágio de publicação
FROM build AS publish
RUN dotnet publish "SGF.API.csproj" -c Release -o /app/publish /p:UseAppHost=false
# Estágio final - runtime
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "SGF.API.dll"]