Skip to content

Commit

Permalink
Use node 20
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasr8 committed Nov 9, 2023
1 parent 98d6d02 commit e3be749
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# builder image
FROM python:3.11 AS builder

RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get update && apt-get install -y nodejs npm

ADD . /build/
WORKDIR /build

RUN ./install_node.sh

RUN HUSKY_SKIP_INSTALL=1 make
RUN make build

Expand Down
7 changes: 5 additions & 2 deletions docker-compose.development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ services:
source: .prettierrc.yaml
target: /newdle/client/.prettierrc.yaml
read_only: true
- type: bind
source: install_node.sh
target: /newdle/client/install_node.sh
read_only: true
ports:
- 3000:3000
depends_on:
Expand All @@ -59,8 +63,7 @@ services:
- bash
- -c
- |
curl -sL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs npm
./install_node.sh
npm install
npm run extract
npm run compile
Expand Down
16 changes: 16 additions & 0 deletions install_node.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://github.com/nodesource/distributions#installation-instructions
NODE_MAJOR=20

apt-get update
apt-get install -y ca-certificates curl gnupg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key |
gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg

# Create node deb repository
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" |
tee /etc/apt/sources.list.d/nodesource.list

# Install node and npm
apt-get update
apt-get install nodejs -y

0 comments on commit e3be749

Please sign in to comment.