-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (28 loc) · 1 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
29
30
#===========================================#
# DOTNET BUILD #
#===========================================#
FROM microsoft/dotnet:2.2-sdk as dotnet-build
ARG DOTNET_CONFIG=Release
WORKDIR /build
COPY *.sln .
COPY /app/MidnightLizard.KafkaConnect.ElasticSearch.csproj ./app/
RUN dotnet restore
COPY . .
RUN dotnet publish app -c ${DOTNET_CONFIG} -o ./results
#===========================================#
# DOTNET TEST #
#===========================================#
FROM microsoft/dotnet:2.2-sdk as dotnet-test
WORKDIR /test
COPY --from=dotnet-build /build .
RUN dotnet test -c Test
#===========================================#
# IMAGE BUILD #
#===========================================#
FROM microsoft/dotnet:2.2-aspnetcore-runtime as image
ARG INSTALL_CLRDBG
RUN bash -c "${INSTALL_CLRDBG}"
WORKDIR /app
EXPOSE 80
COPY --from=dotnet-build /build/app/results .
ENTRYPOINT ["dotnet", "MidnightLizard.KafkaConnect.ElasticSearch.dll"]