forked from LeeRoyManea/KestrelStaticFileServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (19 loc) · 817 Bytes
/
Dockerfile
File metadata and controls
28 lines (19 loc) · 817 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
FROM mcr.microsoft.com/dotnet/sdk:latest AS base
WORKDIR /app
EXPOSE 80
ENV TZ=Europe/Zurich
ENV DEBIAN_FRONTEND=noninteractive
ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS="http://+:80"
FROM mcr.microsoft.com/dotnet/sdk:latest AS build
WORKDIR /src
COPY . ./
RUN dotnet restore "KestrelStaticFileServer/KestrelStaticFileServer.csproj"
RUN dotnet build "KestrelStaticFileServer/KestrelStaticFileServer.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "KestrelStaticFileServer/KestrelStaticFileServer.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
HEALTHCHECK --interval=5s --timeout=3s CMD curl --silent --fail http://localhost:80/health || exit 1
ENTRYPOINT ["dotnet", "KestrelStaticFileServer.dll"]