Docker + CI/CD
All checks were successful
Build and deploy / Publish image (push) Successful in 49s

This commit is contained in:
2025-01-02 15:56:23 +03:00
parent 947906b8a7
commit 0453befc60
5 changed files with 116 additions and 14 deletions

View File

@@ -1,16 +1,17 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0.11-alpine3.20 AS base
USER root
RUN apk update && apk add --no-cache curl icu tzdata musl-locales musl-locales-lang
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Otchinslator/Otchinslator.csproj", "Otchinslator/"]
RUN dotnet restore "Otchinslator/Otchinslator.csproj"
COPY ["Otchinslator.csproj", "Otchinslator.csproj"]
RUN dotnet restore "Otchinslator.csproj"
COPY . .
WORKDIR "/src/Otchinslator"
WORKDIR "/src"
RUN dotnet build "Otchinslator.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
@@ -19,5 +20,6 @@ RUN dotnet publish "Otchinslator.csproj" -c $BUILD_CONFIGURATION -o /app/publish
FROM base AS final
WORKDIR /app
# HEALTHCHECK --interval=5s --timeout=10s --retries=3 CMD curl --fail http://localhost:8000/health || exit 1
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Otchinslator.dll"]

View File

@@ -1,8 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}