Skip to content

Commit

Permalink
Merge pull request #1447 from glensc/base-image
Browse files Browse the repository at this point in the history
Add base layer dockerfile for common setup
  • Loading branch information
orta committed May 21, 2024
2 parents 5d8a25f + d7c12e0 commit 8d8df4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 . .
Expand All @@ -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
Expand Down

0 comments on commit 8d8df4b

Please sign in to comment.