🔨 Fix build script missing npm and node
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||||
USER $APP_UID
|
USER $APP_UID
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
@@ -7,8 +7,20 @@ EXPOSE 8081
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
|
# Install Node.js 22 and npm
|
||||||
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
|
&& apt-get -y install --no-install-recommends curl ca-certificates \
|
||||||
|
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
|
||||||
|
&& apt-get -y install --no-install-recommends nodejs \
|
||||||
|
&& npm install -g npm \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Restore NuGet packages
|
||||||
COPY ["DysonNetwork.Pass/DysonNetwork.Pass.csproj", "DysonNetwork.Pass/"]
|
COPY ["DysonNetwork.Pass/DysonNetwork.Pass.csproj", "DysonNetwork.Pass/"]
|
||||||
RUN dotnet restore "DysonNetwork.Pass/DysonNetwork.Pass.csproj"
|
RUN dotnet restore "DysonNetwork.Pass/DysonNetwork.Pass.csproj"
|
||||||
|
|
||||||
|
# Copy everything and build
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR "/src/DysonNetwork.Pass"
|
WORKDIR "/src/DysonNetwork.Pass"
|
||||||
RUN dotnet build "./DysonNetwork.Pass.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
RUN dotnet build "./DysonNetwork.Pass.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||||
|
@@ -1,18 +1,6 @@
|
|||||||
# -------- Base runtime image --------
|
# -------- Base runtime image --------
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||||
|
|
||||||
# Install only necessary dependencies
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
libfontconfig1 \
|
|
||||||
libfreetype6 \
|
|
||||||
libpng-dev \
|
|
||||||
libharfbuzz0b \
|
|
||||||
libgif7 \
|
|
||||||
libvips \
|
|
||||||
ffmpeg \
|
|
||||||
&& apt-get clean \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Use non-root user if defined in Docker run
|
# Use non-root user if defined in Docker run
|
||||||
USER ${APP_UID:-1000}
|
USER ${APP_UID:-1000}
|
||||||
|
|
||||||
@@ -24,6 +12,14 @@ FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
|||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
|
# Install Node.js 22 and npm
|
||||||
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
|
&& apt-get -y install --no-install-recommends curl ca-certificates \
|
||||||
|
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
|
||||||
|
&& apt-get -y install --no-install-recommends nodejs \
|
||||||
|
&& npm install -g npm \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy everything and build
|
# Copy everything and build
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR /src/DysonNetwork.Sphere
|
WORKDIR /src/DysonNetwork.Sphere
|
||||||
|
Reference in New Issue
Block a user