-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (27 loc) · 840 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (27 loc) · 840 Bytes
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
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS server
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY server/ChurchTools/ChurchTools.csproj ./ChurchTools/
COPY server/Mailist/Mailist.csproj ./Mailist/
RUN dotnet restore Mailist
# Copy everything else and build
COPY server ./
RUN dotnet publish -c Release -o /app/out Mailist
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
# Install curl for healthcheck
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY --from=server /app/out .
HEALTHCHECK \
--interval=1m \
--timeout=10s \
--start-period=15s \
--start-interval=5s \
--retries=3 \
CMD curl --fail http://localhost:8080/healthz || exit 1
ENTRYPOINT ["dotnet", "Mailist.dll"]