Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Frontend Node Version #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 8 additions & 6 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ FROM node:14.21.3-alpine

WORKDIR /app

COPY package.json .
COPY package-lock.json .
COPY package*.json .

RUN npm install
RUN npm ci

COPY . ./app
COPY . .

# npm build:assets (invoked by build) expects src/client to exist, so create it.
RUN mkdir -p src/client
RUN npm run build

ENV PORT=9000
EXPOSE 9000

CMD ["npm", "start"]
CMD ["node", "./build/server.js"]
14 changes: 0 additions & 14 deletions api/Dockerfile.compose

This file was deleted.

17 changes: 0 additions & 17 deletions api/Dockerfile.dev

This file was deleted.

11 changes: 1 addition & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
version: "3.7"

services:
api:
container_name: api
build:
context: api
dockerfile: Dockerfile.compose
dockerfile: Dockerfile
environment:
- POSTGRES_URI=postgres://docker_pg_user:docker_pg_pw@db:5432/docker_db
- POSTGRES_DISABLE_SSL=true
- NODE_ENV=docker
- PORT=9000
- APP_ENV=docker
- ADMIN_TOKEN=admin
volumes:
- ./api:/opt/node_app/app
- ./db:/opt/node_app/db
- /opt/node_app/app/node_modules
ports:
- 9000:9000
- 9229:9229
Expand All @@ -35,9 +29,6 @@ services:
- REACT_APP_ENV=docker
- CHOKIDAR_USEPOLLING=true
- PORT=8000
volumes:
- /opt/react_app/node_modules
- ./frontend:/opt/react_app
ports:
- 8000:8000
expose:
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