-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (24 loc) · 1.05 KB
/
Dockerfile
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
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS tests
WORKDIR /src
COPY ["/src", "/src"]
ARG TEST_DB_CONNECTION_STRING
RUN dotnet test --verbosity normal
RUN dotnet restore "AndreyGames.Leaderboards.Service/AndreyGames.Leaderboards.Service.csproj"
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
COPY . .
WORKDIR "/src/AndreyGames.Leaderboards.Service"
RUN dotnet build "AndreyGames.Leaderboards.Service.csproj" -c Release -o /app/build
FROM build AS publish
ARG NAMESPACE
ARG NUGET_KEY
RUN dotnet publish "AndreyGames.Leaderboards.Service.csproj" -c Release -o /app/publish
RUN dotnet pack "../AndreyGames.Leaderboards.Tests/AndreyGames.Leaderboards.Tests.csproj" --configuration Release
RUN dotnet nuget push "../AndreyGames.Leaderboards.API/bin/Release/*.nupkg" --source https://nuget.pkg.github.com/${NAMESPACE}/index.json --api-key $NUGET_KEY --skip-duplicate
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "AndreyGames.Leaderboards.Service.dll"]