forked from Soluto/oidc-server-mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (25 loc) · 1.3 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
31
32
33
34
35
36
37
38
39
# Stage 1: Build
FROM mcr.microsoft.com/dotnet/sdk:6.0 as source
ARG target="Release"
RUN apt-get update && apt-get install unzip -y
WORKDIR /src
RUN curl -L https://raw.githubusercontent.com/DuendeSoftware/IdentityServer.Quickstart.UI/main/getmain.sh | bash
COPY ./OpenIdConnectServerMock.csproj ./OpenIdConnectServerMock.csproj
RUN dotnet restore
COPY . .
RUN dotnet publish -c $target -o obj/docker/publish
RUN cp -r /src/obj/docker/publish /OpenIdConnectServerMock
# Stage 2: Release
FROM mcr.microsoft.com/dotnet/aspnet:6.0 as release
ARG target="Release"
RUN apt-get update && apt-get install curl -y && rm -rf /var/lib/apt/lists/*
RUN if [ $target = "Debug" ]; then apt-get install unzip && rm -rf /var/lib/apt/lists/* && curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg; fi
COPY --from=source /OpenIdConnectServerMock /OpenIdConnectServerMock
WORKDIR /OpenIdConnectServerMock
ENV ASPNETCORE_ENVIRONMENT=Development
# Disable reload of the config, as M1 Macs don't support it. See https://github.com/elsa-workflows/elsa-core/issues/3114
ENV ASPNETCORE_hostBuilder__reloadConfigOnChange: "false"
EXPOSE 80
HEALTHCHECK --start-period=2s --interval=1s --timeout=100ms --retries=10 \
CMD curl -f http://localhost/health || exit 1
ENTRYPOINT ["dotnet", "OpenIdConnectServerMock.dll" ]