Skip to content

Commit

Permalink
Upgrade frontend local Docker base to node:16.20.2
Browse files Browse the repository at this point in the history
This allows us to maintain package-lock.json with lockFileVersion 2.

Bump buildpack Node version to 16.

Updating to Node 16 requires using a fork of react-loading-overlay which supports React 17... which this app already uses, but it wont build in Node 16 with the unforked package. Not sure how this worked before, but this is what I've discovered.

Frontend wont build in Node > 16 so that what I've chosen. I tried Node 18 but it wont build, and complains of gyp errors.
  • Loading branch information
JuliusSkylerSladeUSDS committed Jan 22, 2025
1 parent 939b614 commit 692c923
Show file tree
Hide file tree
Showing 6 changed files with 14,339 additions and 11,726 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/push-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ jobs:
path: ./api/src/client
key: ${{ runner.os }}-frontend-src-prod-${{ hashFiles('./frontend/src/**/*', './frontend/package.json') }}

# Build frontend (requires node 12)
# Build frontend (requires node 16)
- uses: actions/setup-node@v2
with:
node-version: "12"
node-version: "16"

- name: Install frontend dependencies
if: steps.frontend-npm-cache.outputs.cache-hit != 'true'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ jobs:
path: ./api/src/client
key: ${{ runner.os }}-frontend-src-${{ hashFiles('./frontend/src/**/*', './frontend/package.json') }}

# Build frontend (requires node 12)
# Build frontend (requires node 16)
- uses: actions/setup-node@v2
with:
node-version: "12"
node-version: "16"

- name: Install frontend dependencies
if: steps.frontend-npm-cache.outputs.cache-hit != 'true'
Expand Down
14 changes: 4 additions & 10 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
FROM node:12.16.2 AS builder
RUN curl -o- -L https://yarnpkg.com/install.sh | bash
FROM node:16.20.2

# set working directory

ENV WKDIR /opt/react_app
ENV WKDIR=/opt/react_app
WORKDIR ${WKDIR}


# RUN npm install -g node-sass
RUN npm -g i react-scripts@3.4.1
RUN npm -g i serve

COPY package*.json .

RUN npm ci

ENV PATH ${WKDIR}/node_modules/.bin:$PATH

ENV PATH=${WKDIR}/node_modules/.bin:$PATH

COPY . .

CMD ["npm", "start"]
CMD ["npm", "start"]
Loading

0 comments on commit 692c923

Please sign in to comment.