Skip to content

Commit

Permalink
chore: update all node to 18.18.2
Browse files Browse the repository at this point in the history
The frontend was already on 18 but the backend was separately
using 14. This update involved only meaningful changes in the
Dockerfile.
  • Loading branch information
Sinetheta committed Sep 4, 2024
1 parent 03d6470 commit c25e9d9
Show file tree
Hide file tree
Showing 9 changed files with 1,657 additions and 1,988 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/frontend_install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ runs:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 14.18
node-version: 18.18.2
- name: Install frontend Node.js dependencies
working-directory: frontend
shell: bash
Expand Down
56 changes: 15 additions & 41 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,56 +1,30 @@
FROM --platform=amd64 node:16 as build-frontend
# Cannot use alpine because we need a distro that uses glibgc instead of musl for node-canvas
# eg: https://github.com/nodejs/build/issues/1140
# canvas prebuilds to target https://github.com/Automattic/node-canvas/releases
FROM --platform=amd64 node:18-slim

# Set the working directory
WORKDIR /app

# Add the source code to app
COPY ./frontend /app/bpni
COPY ./lib /app/lib

# Generate the lib packages
WORKDIR /app/lib
RUN npm install

WORKDIR /app/bpni

# Install all the backend dependencies
RUN npm install

# Generate the build of the application
RUN npm run build

# Copy the build output to replace the default nginx contents.

# Stage 1: Compile and Build angular codebase

# Use official node image as the base image
FROM --platform=amd64 node:14 as build

# Set the working directory
WORKDIR /app
RUN npm install -g [email protected]

# Add the source code to app
COPY ./ /app/bpni

# Set the new working dir
WORKDIR /app/bpni

# Generate the lib packages
WORKDIR /app/bpni/lib
RUN npm install
RUN npm ci --verbose

# Install all the backend dependencies
WORKDIR /app/bpni
RUN npm install
# build the frontend
WORKDIR /app/bpni/frontend
RUN npm ci --verbose
ENV NG_CLI_ANALYTICS=false
RUN npm run build

# Generate the build of the application
# build the backend
WORKDIR /app/bpni
RUN npm ci --verbose
RUN npm run tsc

# Copy over frontend
COPY --from=build-frontend /app/bpni/dist/blueprintnotincluded /app/bpni/app/public
RUN cp -r frontend/dist/blueprintnotincluded/* app/public

# Expose port 3000
EXPOSE 3000

#RUN npm run dev
ENTRYPOINT npm run dev
4 changes: 2 additions & 2 deletions deploy.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=amd64 node:14-alpine as extract
FROM --platform=amd64 node:18-alpine3.17 as extract

WORKDIR /bpni

Expand Down Expand Up @@ -32,7 +32,7 @@ COPY ./lib ../lib
COPY ./frontend ./
RUN npm run build -- --output-path=../build/app/public/

FROM --platform=amd64 node:14-alpine as serve-prod
FROM --platform=amd64 node:18-alpine3.17 as serve-prod
WORKDIR /bpni
COPY package*.json ./
RUN npm ci --omit=dev --ignore-scripts && npm cache clean --force
Expand Down
Loading

0 comments on commit c25e9d9

Please sign in to comment.