Skip to content

Commit

Permalink
docker: use node 21
Browse files Browse the repository at this point in the history
Node 21 moves the native fetch api which we use from experimental support
to stable. It also adds an experimental native ws library, see:
https://nodejs.org/en/blog/announcements/v21-release-announce
  • Loading branch information
Pieloaf committed Oct 26, 2023
1 parent 9c4b635 commit a00d58a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## build environment
FROM node:20-alpine as node_server
FROM node:21.1.0-alpine as build_env
WORKDIR /src
# Copy entire project
COPY . .
Expand All @@ -9,16 +9,16 @@ RUN yarn install --frozen-lockfile && yarn cache clean
RUN yarn run build

# production environment
FROM node:20-alpine
FROM node:21.1.0-alpine as runtime_env
ENV NODE_ENV=production
# Copy build output to working dir
WORKDIR /app
COPY --from=node_server /src/build ./
COPY --from=build_env /src/build ./
# HACK: THIS IS A WORKAROUND FOR MOCKED DATA
COPY --from=node_server /src/data ./data
COPY --from=build_env /src/data ./data
# Copy required packages and app config
COPY --from=node_server /src/yarn.lock ./
COPY --from=node_server /src/package.json ./
COPY --from=build_env /src/yarn.lock ./
COPY --from=build_env /src/package.json ./
RUN yarn install --frozen-lockfile --production && yarn cache clean
RUN printenv
CMD node ./index.js

0 comments on commit a00d58a

Please sign in to comment.