-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.api
26 lines (21 loc) · 1.16 KB
/
Dockerfile.api
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
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /storesc
COPY ["src/StorEsc.Api/StorEsc.Api.csproj", "StorEsc.Api/"]
COPY ["src/StorEsc.ApplicationServices/StorEsc.ApplicationServices.csproj", "StorEsc.ApplicationServices/"]
COPY ["src/StorEsc.DomainServices/StorEsc.DomainServices.csproj", "StorEsc.DomainServices/"]
COPY ["src/StorEsc.Domain/StorEsc.Domain.csproj", "StorEsc.Domain/"]
COPY ["src/StorEsc.Infrastructure/StorEsc.Infrastructure.csproj", "StorEsc.Infrastructure/"]
COPY ["src/StorEsc.Infrastructure.ExternalServices/StorEsc.Infrastructure.ExternalServices.csproj", "StorEsc.Infrastructure.ExternalServices/"]
COPY ["src/StorEsc.Core/StorEsc.Core.csproj", "StorEsc.Core/"]
COPY ["src/StorEsc.IoC/StorEsc.IoC.csproj", "StorEsc.IoC/"]
RUN dotnet restore "StorEsc.Api/StorEsc.Api.csproj"
WORKDIR "/storesc/api"
COPY . .
RUN dotnet build "src/StorEsc.Api/StorEsc.Api.csproj" -c Release -o build
RUN dotnet publish "src/StorEsc.Api/StorEsc.Api.csproj" -c Release -o publish
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
WORKDIR /published-app
COPY --from=build-env /storesc/api/publish .
EXPOSE 443
EXPOSE 80
ENTRYPOINT ["dotnet", "StorEsc.Api.dll"]