1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-30 17:22:20 -05:00

Fix gulp for Admin/Sso

This commit is contained in:
Vince Grassia 2023-11-15 17:34:11 -05:00
parent e8e7820ef6
commit 586bac8018
No known key found for this signature in database
GPG Key ID: 9AD7505E8448CC08
2 changed files with 44 additions and 0 deletions

View File

@ -5,6 +5,8 @@ FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:6.0 AS build
# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM
ENV NODE_VERSION=16.20.2
ENV NVM_DIR /usr/local/nvm
# Determine proper runtime value for .NET
# We put the value in a file to be read by later layers.
@ -17,6 +19,24 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
fi \
&& echo "RID=$RID" > /tmp/rid.txt
# Add packages
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set up Node
RUN mkdir -p $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
# Install gulp
RUN npm install -g gulp
# Copy csproj files as distinct layers
WORKDIR /source
COPY bitwarden_license/src/Sso/*.csproj ./bitwarden_license/src/Sso/
@ -41,6 +61,8 @@ COPY .git/. ./.git/
# Build Sso app
WORKDIR /source/bitwarden_license/src/Sso
RUN npm install
RUN gulp --gulpfile "gulpfile.js" build
RUN . /tmp/rid.txt && dotnet publish -c release -o /app/Sso --no-restore --no-self-contained -r $RID
WORKDIR /app

View File

@ -5,6 +5,8 @@ FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:6.0 AS build
# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM
ARG NODE_VERSION=16.20.2
ENV NVM_DIR /usr/local/nvm
# Determine proper runtime value for .NET
# We put the value in a file to be read by later layers.
@ -17,6 +19,24 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
fi \
&& echo "RID=$RID" > /tmp/rid.txt
# Add packages
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set up Node
RUN mkdir -p $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
# Install gulp
RUN npm install -g gulp
# Copy csproj files as distinct layers
WORKDIR /source
COPY src/Admin/*.csproj ./src/Admin/
@ -54,6 +74,8 @@ COPY .git/. ./.git/
# Build Admin app
WORKDIR /source/src/Admin
RUN npm install
RUN gulp --gulpfile "gulpfile.js" build
RUN . /tmp/rid.txt && dotnet publish -c release -o /app/Admin --no-restore --no-self-contained -r $RID
WORKDIR /app