From 73cc40ac5b77813a81d9dd711fc94f01a0b6c589 Mon Sep 17 00:00:00 2001 From: xuef Date: Fri, 15 Mar 2024 07:42:00 +0000 Subject: [PATCH] Upgrade packages. --- Dockerfile | 9 ++++++++- src/Aiursoft.ChessServer/Aiursoft.ChessServer.csproj | 2 +- src/Aiursoft.ChessServer/Program.cs | 2 +- tests/Aiursoft.ChessServer.Tests/BasicTests.cs | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d7f18b7..ef7092c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,10 @@ ARG PROJ_NAME WORKDIR /app COPY --from=build-env /app . +# Install wget and curl +RUN apt update; DEBIAN_FRONTEND=noninteractive apt install -y wget curl + +# Edit appsettings.json RUN sed -i 's/DataSource=app.db/DataSource=\/data\/app.db/g' appsettings.json RUN sed -i 's/\/tmp\/data/\/data/g' appsettings.json RUN mkdir -p /data @@ -51,4 +55,7 @@ ENTRYPOINT ["/bin/bash", "-c", "\ fi && \ ln -s $VOL_SETTINGS $SRC_SETTINGS && \ dotnet $DLL_NAME --urls http://*:5000 \ -"] \ No newline at end of file +"] + +HEALTHCHECK --interval=10s --timeout=3s --start-period=180s --retries=3 CMD \ +wget --quiet --tries=1 --spider http://localhost:5000/health || exit 1 \ No newline at end of file diff --git a/src/Aiursoft.ChessServer/Aiursoft.ChessServer.csproj b/src/Aiursoft.ChessServer/Aiursoft.ChessServer.csproj index 9fc3054..16412bf 100644 --- a/src/Aiursoft.ChessServer/Aiursoft.ChessServer.csproj +++ b/src/Aiursoft.ChessServer/Aiursoft.ChessServer.csproj @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/src/Aiursoft.ChessServer/Program.cs b/src/Aiursoft.ChessServer/Program.cs index e874230..001d219 100644 --- a/src/Aiursoft.ChessServer/Program.cs +++ b/src/Aiursoft.ChessServer/Program.cs @@ -7,7 +7,7 @@ public abstract class Program { public static async Task Main(string[] args) { - var app = WebTools.Extends.App(args); + var app = await WebTools.Extends.AppAsync(args); await app.RunAsync(); } } \ No newline at end of file diff --git a/tests/Aiursoft.ChessServer.Tests/BasicTests.cs b/tests/Aiursoft.ChessServer.Tests/BasicTests.cs index 1bba0a4..3b31413 100644 --- a/tests/Aiursoft.ChessServer.Tests/BasicTests.cs +++ b/tests/Aiursoft.ChessServer.Tests/BasicTests.cs @@ -26,7 +26,7 @@ public class BasicTests [TestInitialize] public async Task CreateServer() { - _server = App(Array.Empty(), port: _port); + _server = await AppAsync(Array.Empty(), port: _port); await _server.StartAsync(); }