Files

22 lines
819 B
Docker

FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
WORKDIR /src
COPY src/SlaySharp.Core/SlaySharp.Core.csproj src/SlaySharp.Core/
COPY src/SlaySharp.Web/SlaySharp.Web.csproj src/SlaySharp.Web/
RUN dotnet restore src/SlaySharp.Web/SlaySharp.Web.csproj \
--source https://api.nuget.org/v3/index.json
COPY src/SlaySharp.Core/ src/SlaySharp.Core/
COPY src/SlaySharp.Web/ src/SlaySharp.Web/
RUN dotnet publish src/SlaySharp.Web/SlaySharp.Web.csproj \
--configuration Release \
--output /app/publish \
--no-restore
FROM nginx:1.27-alpine AS final
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/publish/wwwroot /usr/share/nginx/html
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget --quiet --spider http://127.0.0.1:8080/ || exit 1