File tree Expand file tree Collapse file tree 2 files changed +31
-29
lines changed
Expand file tree Collapse file tree 2 files changed +31
-29
lines changed Original file line number Diff line number Diff line change 1+ FROM elipe17/tdp-frontend-base:latest AS localdev
12
2- # Stage 0: Create the app directory, install dependencies, and copy in the source code
3- FROM node:16.13-alpine3.14 AS localdev
4-
5- # Due to M1 issues found here, adding solution:
6- # https://stackoverflow.com/questions/69983063/
7- RUN apk add chromium
8- ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
9- PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
10-
11- USER node
12-
13-
14- RUN mkdir /home/node/app/ && chown -R node:node /home/node/app
15- WORKDIR /home/node/app
16-
17- # Copy package.json and run npm install before copying the rest of the app in
18- # to allow Docker to cache the npm layer to prevent unnecessary installations
19- # when code changes occur
20- COPY --chown=node:node package.json package-lock.json ./
21-
22- # Disable npm audit
23- RUN npm set audit false
24- # Install npm packages directly from package-lock.json <https://docs.npmjs.com/cli/v8/commands/npm-ci>
25- RUN npm ci
26-
27-
3+ # ---
4+ # Stage 0: Copy source
285COPY --chown=node:node . .
296
30- ENV PORT=80
31- EXPOSE 80
32-
337# ---
348# Stage 1: Create a production build
359FROM localdev AS build
Original file line number Diff line number Diff line change 1+
2+ # Stage 0: Create the app directory, install dependencies, and copy in the source code
3+ FROM node:16.13-alpine3.14 AS localdev
4+
5+ # Due to M1 issues found here, adding solution:
6+ # https://stackoverflow.com/questions/69983063/
7+ RUN apk add chromium
8+ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
9+ PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
10+
11+ USER node
12+
13+
14+ RUN mkdir /home/node/app/ && chown -R node:node /home/node/app
15+ WORKDIR /home/node/app
16+
17+ # Copy package.json and run npm install before copying the rest of the app in
18+ # to allow Docker to cache the npm layer to prevent unnecessary installations
19+ # when code changes occur
20+ COPY --chown=node:node package.json package-lock.json ./
21+
22+ # Disable npm audit
23+ RUN npm set audit false
24+ # Install npm packages directly from package-lock.json <https://docs.npmjs.com/cli/v8/commands/npm-ci>
25+ RUN npm ci
26+
27+ ENV PORT=80
28+ EXPOSE 80
You can’t perform that action at this time.
0 commit comments