Skip to content

Commit 147bae5

Browse files
authored
Bump dotnet to 8 LTS and get rid of 404 on index page. (#5)
* Upgrade to .net8 LTS. Signed-off-by: Mariusz Fik <[email protected]> * Get rid of 404 for / in favor of a simple message. Signed-off-by: Mariusz Fik <[email protected]> --------- Signed-off-by: Mariusz Fik <[email protected]>
1 parent 92524b6 commit 147bae5

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

Controllers/SyncController.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ public SyncController(KosyncDb db, UserService userService)
1515
_userService = userService;
1616
}
1717

18+
[HttpGet("/")]
19+
public IActionResult Index()
20+
{
21+
return Ok("kosync-dotnet server is running.");
22+
}
23+
1824
[HttpGet("/healthcheck")]
1925
public ObjectResult HealthCheck()
2026
{

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Build environment
2-
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build-env
2+
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build-env
33
WORKDIR /app
44
COPY . ./
55
RUN dotnet restore
66
RUN dotnet publish -c Release -o output
77

88
# Runtime environment
9-
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine
9+
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
10+
EXPOSE 8080
1011
WORKDIR /app
1112
COPY --from=build-env /app/output .
1213
ENTRYPOINT ["dotnet", "Kosync.dll"]

Kosync.csproj

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
2-
32
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
54
<Nullable>enable</Nullable>
65
<ImplicitUsings>enable</ImplicitUsings>
76
</PropertyGroup>
8-
97
<ItemGroup>
108
<PackageReference Include="LiteDB" Version="5.0.16" />
11-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.3" />
9+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.11" />
1210
</ItemGroup>
13-
14-
</Project>
11+
</Project>

0 commit comments

Comments
 (0)