🗑️ Remove SPA builder from dockerfile

This commit is contained in:
2025-09-19 00:17:22 +08:00
parent 634958ffc5
commit 2ace444dbb
16 changed files with 174 additions and 846 deletions

View File

@@ -5,24 +5,7 @@ WORKDIR /app
EXPOSE 8080
EXPOSE 8081
# Stage 2: Build SPA
FROM node:22-alpine AS spa-builder
WORKDIR /src
# Copy package files for SPA
COPY ["DysonNetwork.Sphere/Client/package.json", "DysonNetwork.Sphere/Client/package-lock.json*", "./Client/"]
# Install SPA dependencies
WORKDIR /src/Client
RUN npm install
# Copy SPA source
COPY ["DysonNetwork.Sphere/Client/", "./"]
# Build SPA
RUN npm run build
# Stage 3: Build .NET application
# Stage 2: Build .NET application
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
@@ -38,12 +21,6 @@ RUN dotnet restore "DysonNetwork.Sphere/DysonNetwork.Sphere.csproj"
# Copy everything else and build
COPY . .
# Copy built SPA to wwwroot
COPY --from=spa-builder /src/Client/dist /src/DysonNetwork.Sphere/wwwroot/dist
# Remove Pass project's config files to prevent conflicts
RUN rm -f /src/DysonNetwork.Pass/appsettings*.json /src/DysonNetwork.Pass/version.json
# Create necessary directories for localized resources
RUN mkdir -p /src/DysonNetwork.Sphere/bin/Release/net9.0/zh-hans \
&& mkdir -p /src/DysonNetwork.Pass/bin/Release/net9.0/zh-hans
@@ -58,7 +35,6 @@ RUN dotnet build "DysonNetwork.Sphere.csproj" -c $BUILD_CONFIGURATION -o /app/bu
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
# Ensure the target directory for localized resources exists
RUN rm -rf /src/DysonNetwork.Pass/Client
RUN mkdir -p /app/publish/zh-Hans
RUN dotnet publish "DysonNetwork.Sphere.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

View File

@@ -150,6 +150,19 @@
<_ContentIncludedByDefault Remove="Pages\Emails\LandingEmail.razor" />
<_ContentIncludedByDefault Remove="Pages\Emails\PasswordResetEmail.razor" />
<_ContentIncludedByDefault Remove="Pages\Emails\VerificationEmail.razor" />
<_ContentIncludedByDefault Remove="wwwroot\dist\assets\index-CwhYnE7S.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\assets\index-D09kXPgc.js" />
<_ContentIncludedByDefault Remove="wwwroot\dist\assets\nunito-cyrillic-ext-wght-normal-D4X5GqEv.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\dist\assets\nunito-cyrillic-wght-normal-FdJpG9jw.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\dist\assets\nunito-latin-ext-wght-normal-ClTydo4B.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\dist\assets\nunito-latin-wght-normal-DYSs2pW_.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\dist\assets\nunito-vietnamese-wght-normal-U01xdrZh.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\dist\assets\PostItem-B-fBcnNf.js" />
<_ContentIncludedByDefault Remove="wwwroot\dist\assets\posts-w-kbiv-Q.js" />
<_ContentIncludedByDefault Remove="wwwroot\dist\assets\views-Z9SFj0UP.js" />
<_ContentIncludedByDefault Remove="wwwroot\dist\favicon.png" />
<_ContentIncludedByDefault Remove="wwwroot\dist\image-broken.jpg" />
<_ContentIncludedByDefault Remove="wwwroot\dist\index.html" />
</ItemGroup>
<ItemGroup>