-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (28 loc) · 1 KB
/
Dockerfile
File metadata and controls
46 lines (28 loc) · 1 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
45
46
# Docs build
FROM python:3.14 AS docs-build
WORKDIR /docs
COPY DevOidcToolkit.Documentation /docs
RUN pip install -r requirements.txt
RUN mkdocs build
# App build
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /app
ARG VERSION=0.0.0.0
# Copy csproj and restore as distinct layers
COPY DevOidcToolkit/DevOidcToolkit.csproj ./
RUN dotnet restore
# Copy everything else
COPY DevOidcToolkit/ ./
COPY --from=docs-build /docs/build ./Documentation/
# Build and publish a release
RUN dotnet publish -c Release --no-restore /p:SelfContained=false /p:PublishSingleFile=false -o dist
# App runtime
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app/dist .
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
ENV DevOidcToolkit__Address=0.0.0.0
ENTRYPOINT ["dotnet", "dev-oidc-toolkit.dll"]
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:80/healthz/live || exit 1