-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (28 loc) · 1.24 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
# build
FROM microsoft/dotnet:2.2-sdk-alpine AS build
LABEL stage intermediate
WORKDIR /
COPY Outloud.QuizService/src src
COPY Outloud.QuizService/tests tests
WORKDIR /src
RUN dotnet build Outloud.QuizService.csproj -c Release -o /app --source "https://api.nuget.org/v3/index.json" --source "https://www.myget.org/F/outloud/api/v3/index.json"
WORKDIR /tests
RUN dotnet build Outloud.QuizService.Tests.csproj -c Release -o /tests --source "https://api.nuget.org/v3/index.json" --source "https://www.myget.org/F/outloud/api/v3/index.json"
# publish to /app dir
FROM build AS publish
WORKDIR /src
RUN dotnet publish Outloud.QuizService.csproj -c Release -o /app --source "https://api.nuget.org/v3/index.json" --source "https://www.myget.org/F/outloud/api/v3/index.json"
# copy tests
FROM build AS test
WORKDIR /tests
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.3.0/wait /wait
RUN chmod +x /wait
ENTRYPOINT /wait && dotnet test -c Release --no-restore --logger:trx
# publish
FROM microsoft/dotnet:2.2-aspnetcore-runtime-alpine AS base
WORKDIR /app
COPY --from=publish /app .
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.3.0/wait /wait
RUN chmod +x /wait
ENTRYPOINT /wait && dotnet Outloud.QuizService.dll
EXPOSE 5000