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

docker: use node 21 and debian bookworm #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
docker: use node 21
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
commit a00d58a3eab3edd5039371c13d25423db7c5910f
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