-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (25 loc) · 1.41 KB
/
Copy pathDockerfile
File metadata and controls
30 lines (25 loc) · 1.41 KB
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
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
ENV ASPNETCORE_ENVIRONMENT=Staging
WORKDIR /src
COPY ["WebDavServer.WebApi/WebDavServer.WebApi.csproj", "WebDavServer.WebApi/"]
COPY ["WebDavServer.Infrastructure/WebDavServer.Infrastructure.csproj", "WebDavServer.Infrastructure/"]
COPY ["WebDavServer.Infrastructure.FileStorage/WebDavServer.Infrastructure.FileStorage.csproj", "WebDavServer.Infrastructure.FileStorage/"]
COPY ["WebDavServer.Application/WebDavServer.Application.csproj", "WebDavService.Application/"]
COPY ["WebDavServer.Infrastructure.WebDav/WebDavServer.Infrastructure.WebDav.csproj", "WebDavServer.Infrastructure.WebDav/"]
COPY ["WebDavServer.Infrastructure.Cache/WebDavServer.Infrastructure.Cache.csproj", "WebDavServer.Infrastructure.Cache/"]
RUN dotnet restore "WebDavServer.WebApi/WebDavServer.WebApi.csproj"
COPY . .
WORKDIR "/src/WebDavServer.WebApi"
RUN dotnet build "WebDavServer.WebApi.csproj" -c Release -o /app/build
FROM build AS publish
ENV ASPNETCORE_ENVIRONMENT=Staging
RUN dotnet publish "WebDavServer.WebApi.csproj" -c Release -o /app/publish
FROM base AS final
ENV ASPNETCORE_ENVIRONMENT=Staging
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WebDavServer.WebApi.dll"]