Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions WebAPI/Controllers/SpreadsheetController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,12 @@ public IActionResult Save([FromForm]SaveSettings saveSettings)
{
return Workbook.Save(saveSettings);
}

[HttpGet]
[Route("ping")]
public IActionResult Ping()
{
return Ok();
}
}
}
18 changes: 18 additions & 0 deletions WebAPI/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
7 changes: 7 additions & 0 deletions WebAPI/README.md
Original file line number Diff line number Diff line change
@@ -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