add configs

This commit is contained in:
prixod
2025-10-24 23:55:10 +04:00
parent 6cead15a5f
commit dee93134ae
11 changed files with 648 additions and 45 deletions

View File

@@ -1,21 +1,47 @@
FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base
USER $APP_UID
WORKDIR /app
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
# Copy Common project
COPY ["src/LiquidCode.Tester.Common/LiquidCode.Tester.Common.csproj", "src/LiquidCode.Tester.Common/"]
# Copy Worker project
COPY ["src/LiquidCode.Tester.Worker/LiquidCode.Tester.Worker.csproj", "src/LiquidCode.Tester.Worker/"]
# Restore dependencies
RUN dotnet restore "src/LiquidCode.Tester.Worker/LiquidCode.Tester.Worker.csproj"
# Copy all source files
COPY . .
# Build
WORKDIR "/src/src/LiquidCode.Tester.Worker"
RUN dotnet build "./LiquidCode.Tester.Worker.csproj" -c $BUILD_CONFIGURATION -o /app/build
# Publish stage
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./LiquidCode.Tester.Worker.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
# Final stage - use aspnet runtime with C++ compiler
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
WORKDIR /app
# Install C++ compiler and build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends \
g++ \
gcc \
make \
&& rm -rf /var/lib/apt/lists/*
# Copy published app
COPY --from=publish /app/publish .
# Create temp directory for compilation and testing
RUN mkdir -p /tmp/testing
ENV ASPNETCORE_URLS=http://+:8080
ENTRYPOINT ["dotnet", "LiquidCode.Tester.Worker.dll"]