add configs
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base
|
||||
USER $APP_UID
|
||||
WORKDIR /app
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["src/LiquidCode.Tester.Common/LiquidCode.Tester.Common.csproj", "src/LiquidCode.Tester.Common/"]
|
||||
RUN dotnet restore "src/LiquidCode.Tester.Common/LiquidCode.Tester.Common.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/src/LiquidCode.Tester.Common"
|
||||
RUN dotnet build "./LiquidCode.Tester.Common.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./LiquidCode.Tester.Common.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "LiquidCode.Tester.Common.dll"]
|
||||
@@ -1,16 +1,25 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||
USER $APP_UID
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["LiquidCode.Tester.Gateway/LiquidCode.Tester.Gateway.csproj", "LiquidCode.Tester.Gateway/"]
|
||||
RUN dotnet restore "LiquidCode.Tester.Gateway/LiquidCode.Tester.Gateway.csproj"
|
||||
|
||||
# Copy Common project
|
||||
COPY ["src/LiquidCode.Tester.Common/LiquidCode.Tester.Common.csproj", "src/LiquidCode.Tester.Common/"]
|
||||
|
||||
# Copy Gateway project
|
||||
COPY ["src/LiquidCode.Tester.Gateway/LiquidCode.Tester.Gateway.csproj", "src/LiquidCode.Tester.Gateway/"]
|
||||
|
||||
# Restore dependencies
|
||||
RUN dotnet restore "src/LiquidCode.Tester.Gateway/LiquidCode.Tester.Gateway.csproj"
|
||||
|
||||
# Copy all source files
|
||||
COPY . .
|
||||
WORKDIR "/src/LiquidCode.Tester.Gateway"
|
||||
|
||||
# Build
|
||||
WORKDIR "/src/src/LiquidCode.Tester.Gateway"
|
||||
RUN dotnet build "./LiquidCode.Tester.Gateway.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
@@ -20,4 +29,10 @@ RUN dotnet publish "./LiquidCode.Tester.Gateway.csproj" -c $BUILD_CONFIGURATION
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
|
||||
# Create directory for package downloads
|
||||
RUN mkdir -p /tmp/packages
|
||||
|
||||
ENV ASPNETCORE_URLS=http://+:8080
|
||||
|
||||
ENTRYPOINT ["dotnet", "LiquidCode.Tester.Gateway.dll"]
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user