diff --git a/WebAPI/Controllers/SpreadsheetController.cs b/WebAPI/Controllers/SpreadsheetController.cs index f5231ed..4bbda1b 100644 --- a/WebAPI/Controllers/SpreadsheetController.cs +++ b/WebAPI/Controllers/SpreadsheetController.cs @@ -30,5 +30,12 @@ public IActionResult Save([FromForm]SaveSettings saveSettings) { return Workbook.Save(saveSettings); } + + [HttpGet] + [Route("ping")] + public IActionResult Ping() + { + return Ok(); + } } } \ No newline at end of file diff --git a/WebAPI/Dockerfile b/WebAPI/Dockerfile new file mode 100644 index 0000000..e6fd337 --- /dev/null +++ b/WebAPI/Dockerfile @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +WORKDIR /WebAPI +RUN pwd +RUN ls + +# Copy everything +COPY . ./ +# Restore as distinct layers +RUN dotnet restore +# Build and publish a release +RUN dotnet publish -c Release -o out + +# Build runtime image +FROM mcr.microsoft.com/dotnet/aspnet:7.0 +WORKDIR /WebAPI + +COPY --from=build-env /WebAPI/out . +ENTRYPOINT ["dotnet", "WebAPI.dll"] \ No newline at end of file diff --git a/WebAPI/README.md b/WebAPI/README.md new file mode 100644 index 0000000..24a297d --- /dev/null +++ b/WebAPI/README.md @@ -0,0 +1,7 @@ +Docker Setup + +// Make image +docker build --progress=plain --no-cache -t syncfusion-webapi-docker -f Dockerfile . + +// Start container with image +docker run -p 80:80/tcp -it --rm syncfusion-webapi-docker \ No newline at end of file