diff --git a/Dockerfile b/Dockerfile index b008a408e..639371f89 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18-slim as build +FROM node:18-slim as base LABEL maintainer="Orta Therox" LABEL "com.github.actions.name"="Danger JS Action" @@ -7,6 +7,8 @@ LABEL "com.github.actions.icon"="zap" LABEL "com.github.actions.color"="blue" WORKDIR /usr/src/danger + +FROM base as build COPY package.json yarn.lock ./ RUN yarn install COPY . . @@ -15,9 +17,7 @@ RUN yarn remove 'typescript' --dev && yarn add 'typescript' RUN yarn install --production --frozen-lockfile RUN chmod +x distribution/commands/danger.js - -FROM node:18-slim -WORKDIR /usr/src/danger +FROM base ENV PATH="/usr/src/danger/node_modules/.bin:$PATH" COPY package.json ./ COPY --from=build /usr/src/danger/distribution ./dist