-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from peris-studio/feat/refactor-api-modelo-de-…
…container-docker-46 [refactor]: adição do modelo de container.
- Loading branch information
Showing
1 changed file
with
14 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base | ||
# Etapa base do runtime | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
|
||
USER app | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG configuration=Release | ||
WORKDIR /src | ||
COPY ["src/LojaDoValdir/LojaDoValdir.csproj", "src/LojaDoValdir/"] | ||
RUN dotnet restore "src/LojaDoValdir/LojaDoValdir.csproj" | ||
# Etapa de build | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
WORKDIR /source | ||
COPY ["LojaDoValdir.csproj", "."] | ||
RUN dotnet restore "LojaDoValdir.csproj" | ||
COPY . . | ||
WORKDIR "/src/src/LojaDoValdir" | ||
RUN dotnet build "LojaDoValdir.csproj" -c $configuration -o /app/build | ||
WORKDIR "/source" | ||
RUN dotnet build "LojaDoValdir.csproj" -c Release -o /app/build | ||
|
||
# Etapa de publicação | ||
FROM build AS publish | ||
ARG configuration=Release | ||
RUN dotnet publish "LojaDoValdir.csproj" -c $configuration -o /app/publish /p:UseAppHost=false | ||
RUN dotnet publish "LojaDoValdir.csproj" -c Release -o /app/publish /p:UseAppHost=false | ||
|
||
# Etapa final | ||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "LojaDoValdir.dll"] | ||
ENTRYPOINT ["dotnet", "LojaDoValdir.dll"] |