From 7315997ee2bde780fc625a40996026d51197fe43 Mon Sep 17 00:00:00 2001 From: Michal Vrba Date: Mon, 19 Oct 2026 16:30:51 +0200 Subject: [PATCH] Prepare Coolify deployment --- .dockerignore | 10 ++++++++++ Dockerfile | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1a5eff1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +.git +.gitignore +.vs +**/bin +**/obj +**/*.user +**/*.suo +README* +data +**/data diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2e817bd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +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"]