Fix dockerfile and logger from DiscordHandler.cs

This commit is contained in:
Dmitri Shimanski
2025-07-30 01:50:32 +03:00
parent 3f8f7b8324
commit 7b3318993e
2 changed files with 23 additions and 4 deletions

View File

@@ -40,7 +40,24 @@ public class DiscordHandler(
private Task ClientOnLog(LogMessage arg)
{
logger.LogInformation(exception: arg.Exception, message:arg.Message);
switch (arg.Severity)
{
case LogSeverity.Info:
logger.LogInformation(arg.Message);
break;
case LogSeverity.Warning:
logger.LogWarning(arg.Message);
break;
case LogSeverity.Error:
logger.LogError(exception: arg.Exception, message: arg.Message);
break;
case LogSeverity.Critical:
logger.LogCritical(arg.Exception, message: arg.Message);
break;
default:
logger.LogTrace(arg.Message);
break;
}
return Task.CompletedTask;
}

View File

@@ -20,9 +20,11 @@ RUN dotnet publish "./Aoyo.Taiga.csproj" -c $BUILD_CONFIGURATION -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
RUN sudo apt-get update && \
sudo apt-get install -y curl && \
sudo rm -rf /var/lib/apt/lists/*
USER root
RUN apt-get update && \
apt-get install -y curl && \
rm -rf /var/lib/apt/lists/*
USER $APP_UID
HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD curl -f http://localhost:8080/aoyo/health || exit 1