-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (34 loc) · 1.06 KB
/
Copy pathDockerfile
File metadata and controls
44 lines (34 loc) · 1.06 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
ARG Auth0__ManagementApiClientSecret
ARG Auth0__ManagementApiClientId
ARG Auth0__Domain
ARG Auth0__ClientSecret
ARG Auth0__ClientId
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
WORKDIR /src
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk AS test
ARG Auth0__ManagementApiClientSecret
ARG Auth0__ManagementApiClientId
ARG Auth0__Domain
ARG Auth0__ClientSecret
ARG Auth0__ClientId
ENV Auth0__ManagementApiClientSecret=$Auth0__ManagementApiClientSecret
ENV Auth0__ManagementApiClientId=$Auth0__ManagementApiClientId
ENV Auth0__Domain=$Auth0__Domain
ENV Auth0__ClientSecret=$Auth0__ClientSecret
ENV Auth0__ClientId=$Auth0__ClientId
WORKDIR /src
COPY . .
RUN dotnet restore
RUN dotnet build --configuration Release --no-restore
RUN dotnet test --no-restore --verbosity normal
FROM mcr.microsoft.com/dotnet/core/sdk AS build
WORKDIR /src
COPY . .
RUN dotnet build Api/Api.csproj -c Release -o app
FROM build AS publish
RUN dotnet publish Api/Api.csproj -c Release -o /src/app
FROM base AS final
WORKDIR /src
COPY --from=publish /src/app .
ENTRYPOINT ["dotnet", "Api.dll"]