Skip to content

Commit 8f0e6b0

Browse files
committed
- Add base docker image for frontend
1 parent 462740c commit 8f0e6b0

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

tdrs-frontend/Dockerfile

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,9 @@
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
285
COPY --chown=node:node . .
296

30-
ENV PORT=80
31-
EXPOSE 80
32-
337
# ---
348
# Stage 1: Create a production build
359
FROM localdev AS build

tdrs-frontend/Dockerfile.base

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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

0 commit comments

Comments
 (0)