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:
parent
e8e7820ef6
commit
586bac8018
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user