Skip to content

Commit

Permalink
add build stage to dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
SmnHgr committed Feb 5, 2024
1 parent 7f7faa9 commit a91d053
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
FROM node:18 as build
COPY . /
RUN npm ci --cache .npm --prefer-offline
RUN npm run build

FROM node:18-alpine

WORKDIR /app

RUN npm install --global serve

COPY ./dist/ ./
COPY --from=build ./dist/ ./

EXPOSE 5000

Expand Down
9 changes: 7 additions & 2 deletions scanner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
FROM node:18 as build
COPY . /
RUN npm ci --cache .npm --prefer-offline
RUN npm run build

FROM node:18

# The next three commands are required for puppeteer to run a headless chrome in the container
Expand All @@ -11,9 +16,9 @@ ENV NODE_ENV production

WORKDIR /app

COPY package*.json ./
COPY --from=build package*.json ./

COPY ./dist/ ./dist
COPY --from=build ./dist/ ./dist

RUN npm clean-install

Expand Down

0 comments on commit a91d053

Please sign in to comment.