OPC # 0001: Extract Clarity into standalone repo
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
# -- Stage 1: Build Vite frontend ---------------------------------------------
|
||||
FROM node:22-alpine AS frontend
|
||||
WORKDIR /frontend
|
||||
|
||||
COPY frontend/package.json frontend/package-lock.json* ./
|
||||
RUN npm ci --legacy-peer-deps
|
||||
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
# Output lands in /frontend/dist
|
||||
|
||||
# -- Stage 2: Build .NET server -----------------------------------------------
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
COPY ["Clarity.Server/Clarity.Server.csproj", "Clarity.Server/"]
|
||||
COPY ["Clarity.ServiceDefaults/Clarity.ServiceDefaults.csproj", "Clarity.ServiceDefaults/"]
|
||||
COPY ["Directory.Packages.props", "./"]
|
||||
|
||||
RUN dotnet restore "Clarity.Server/Clarity.Server.csproj"
|
||||
|
||||
COPY . .
|
||||
|
||||
# Embed the Vite build into wwwroot (mirrors Aspire PublishWithContainerFiles)
|
||||
COPY --from=frontend /frontend/dist ./Clarity.Server/wwwroot/
|
||||
|
||||
RUN dotnet publish "Clarity.Server/Clarity.Server.csproj" \
|
||||
-c Release -o /app/publish
|
||||
|
||||
# -- Stage 3: Runtime ----------------------------------------------------------
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/publish .
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["dotnet", "Clarity.Server.dll"]
|
||||
Reference in New Issue
Block a user