chore: update Dockerfile to run npm i from node:alpine

This commit is contained in:
Oliver Booth 2023-09-29 15:52:28 +01:00
parent 6d6a54336c
commit 3b9440b046
Signed by: oliverbooth
GPG Key ID: E60B570D1B7557B5

View File

@ -3,19 +3,21 @@ WORKDIR /app
EXPOSE 80 EXPOSE 80
EXPOSE 443 EXPOSE 443
FROM node:alpine as build-deps
WORKDIR /src
COPY package.json package-lock.json ./
RUN npm i -g gulp-cli
RUN npm i
COPY . ./
RUN gulp
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
COPY --from=build-deps /src/OliverBooth/wwwroot /src/OliverBooth/wwwroot
WORKDIR /src WORKDIR /src
COPY ["OliverBooth/OliverBooth.csproj", "OliverBooth/"] COPY ["OliverBooth/OliverBooth.csproj", "OliverBooth/"]
RUN dotnet restore "OliverBooth/OliverBooth.csproj" RUN dotnet restore "OliverBooth/OliverBooth.csproj"
COPY . . COPY . .
RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get install -y nodejs
RUN npm i -g gulp-cli
RUN npm i
RUN gulp
WORKDIR "/src/OliverBooth" WORKDIR "/src/OliverBooth"
RUN dotnet build "OliverBooth.csproj" -c Release -o /app/build RUN dotnet build "OliverBooth.csproj" -c Release -o /app/build