Skip to content

Commit

Permalink
Upgrade NodeJS version to 20
Browse files Browse the repository at this point in the history
  • Loading branch information
submarcos authored and dtrucs committed Sep 16, 2024
1 parent 2183387 commit c5dac6d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Installation in development:

## Prerequisite

- You need to use a node version equal or above 18
- You need to use a node version equal or above 20
- Use nvm and then:

```bash
Expand Down
7 changes: 5 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ If you follow the [Install without Docker (not recommended)](#install-without-do
### Sentry

To report application crashes and any errors encountered by users, you can use [Sentry](https://sentry.io/).
In the Sentry backoffice, create your project and copy the DSN key which you can paste into the `SENTRY_DSN` environment variable.
In the Sentry backoffice, create your project and copy the DSN key which you can paste into the `SENTRY_DSN` environment variable.

# Install with Docker (recommended)

## Global process

Before starting the technical installation, here is an overview of the global process:

- Developers are working on code source of this repository where you will also find the documentation, issues and releases
- Once they have a new version of the application ready, they will release it, build a Docker image of this new version and push it in the [packages repository](https://github.com/orgs/GeotrekCE/packages/container/package/geotrek-rando-v3%2Fgeotrek-rando)
- If required, they will also make changes to the docker-compose file and customization template in the [installer dedicated repository](https://github.com/GeotrekCE/Geotrek-rando-v3-installer) and release a new version of it
Expand Down Expand Up @@ -103,6 +104,7 @@ sudo certbot --nginx
## Upgrade Geotrek-rando version

To find out the current Geotrek-rando version of your running container, you can execute (by renaming `rando-nodeserver-1` with the name of your container):

```
docker exec -t -i rando-nodeserver-1 node -p "require('./package.json').version"
```
Expand Down Expand Up @@ -147,7 +149,7 @@ Install nodejs:
sudo apt update
sudo apt -y upgrade
sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates
curl -sL https://deb.nodesource.com/setup_17.x | sudo -E bash -
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt -y install nodejs
```

Expand All @@ -164,6 +166,7 @@ cd Geotrek-rando-v3/frontend/
```

Install dependencies

```sh
yarn
```
Expand Down
2 changes: 1 addition & 1 deletion frontend/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.12.0
v20.17.0
8 changes: 4 additions & 4 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Install dependencies only when needed
FROM node:18-alpine AS deps
FROM node:20-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat g++ gcc libgcc libstdc++ linux-headers make python3
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

# Rebuild the source code only when needed
FROM node:18-alpine AS builder
FROM node:20-alpine AS builder
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
RUN yarn build

FROM node:18-alpine AS builder_optim
FROM node:20-alpine AS builder_optim
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/yarn.lock ./yarn.lock
RUN yarn install --production --ignore-scripts --prefer-offline

# Production image, copy all the files and run next
FROM node:18-alpine AS runner
FROM node:20-alpine AS runner
WORKDIR /app

ENV NODE_ENV production
Expand Down

0 comments on commit c5dac6d

Please sign in to comment.