33 lines
873 B
Docker
33 lines
873 B
Docker
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build
|
|
WORKDIR /src
|
|
|
|
COPY Notemark/Notemark.csproj Notemark/
|
|
RUN dotnet restore Notemark/Notemark.csproj \
|
|
--source https://api.nuget.org/v3/index.json
|
|
|
|
COPY Notemark/ Notemark/
|
|
RUN dotnet publish Notemark/Notemark.csproj \
|
|
--configuration Release \
|
|
--output /app/publish \
|
|
--no-restore
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS final
|
|
WORKDIR /app
|
|
|
|
ENV ASPNETCORE_URLS=http://+:8080 \
|
|
ASPNETCORE_FORWARDEDHEADERS_ENABLED=true \
|
|
NOTEMARK_DATA_DIR=/app/data \
|
|
DOTNET_EnableDiagnostics=0
|
|
|
|
COPY --from=build /app/publish .
|
|
RUN mkdir -p /app/data && chown -R app:app /app
|
|
|
|
USER app
|
|
EXPOSE 8080
|
|
VOLUME ["/app/data"]
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
|
CMD wget --quiet --spider http://127.0.0.1:8080/ || exit 1
|
|
|
|
ENTRYPOINT ["dotnet", "Notemark.dll"]
|