Dockerfile: bump to nodejs 20 (#999)
This commit is contained in:
commit
e153998d29
|
@ -18,7 +18,7 @@ jobs:
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18'
|
node-version: '20'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
cache-dependency-path: |
|
cache-dependency-path: |
|
||||||
|
|
|
@ -20,7 +20,7 @@ jobs:
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18'
|
node-version: '20'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
cache-dependency-path: |
|
cache-dependency-path: |
|
||||||
|
|
17
Dockerfile
17
Dockerfile
|
@ -1,17 +1,20 @@
|
||||||
# There's an issue with node:20-alpine.
|
# As a workaround we have to build on nodejs 18
|
||||||
# Docker deployment is canceled after 25< minutes.
|
# nodejs 20 hangs on build with armv6/armv7
|
||||||
|
|
||||||
FROM docker.io/library/node:18-alpine AS build_node_modules
|
FROM docker.io/library/node:18-alpine AS build_node_modules
|
||||||
|
|
||||||
# Copy Web UI
|
# Copy Web UI
|
||||||
COPY src/ /app/
|
COPY src/ /app/
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN npm ci --omit=dev &&\
|
RUN npm ci --omit=dev &&\
|
||||||
|
# Enable this to run `npm run serve`
|
||||||
|
npm i -g nodemon &&\
|
||||||
|
# Delete unnecessary files
|
||||||
|
npm cache clean --force && rm -rf ~/.npm &&\
|
||||||
mv node_modules /node_modules
|
mv node_modules /node_modules
|
||||||
|
|
||||||
# Copy build result to a new image.
|
# Copy build result to a new image.
|
||||||
# This saves a lot of disk space.
|
# This saves a lot of disk space.
|
||||||
FROM docker.io/library/node:18-alpine
|
FROM docker.io/library/node:20-alpine
|
||||||
COPY --from=build_node_modules /app /app
|
COPY --from=build_node_modules /app /app
|
||||||
|
|
||||||
# Move node_modules one directory up, so during development
|
# Move node_modules one directory up, so during development
|
||||||
|
@ -23,12 +26,6 @@ COPY --from=build_node_modules /app /app
|
||||||
# than what runs inside of docker.
|
# than what runs inside of docker.
|
||||||
COPY --from=build_node_modules /node_modules /node_modules
|
COPY --from=build_node_modules /node_modules /node_modules
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Enable this to run `npm run serve`
|
|
||||||
npm i -g nodemon &&\
|
|
||||||
# Delete unnecessary files
|
|
||||||
npm cache clean --force && rm -rf ~/.npm
|
|
||||||
|
|
||||||
# Install Linux packages
|
# Install Linux packages
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
dpkg \
|
dpkg \
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
"tailwindcss": "^3.4.3"
|
"tailwindcss": "^3.4.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "18"
|
"node": "20"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@aashutoshrathi/word-wrap": {
|
"node_modules/@aashutoshrathi/word-wrap": {
|
||||||
|
|
|
@ -30,6 +30,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "18"
|
"node": "20"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue