Skip to content

Commit

Permalink
use lower node.js version for build to fix npm hanging on arm archite…
Browse files Browse the repository at this point in the history
…cture
  • Loading branch information
poeti8 committed Jan 9, 2025
1 parent 45fa1a9 commit 5c6a337
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# specify node.js image
FROM node:22-alpine
# use older node version for build since arm/v8 threw error when node 20 was used
FROM node:18.19.1-alpine AS build_image

# use production node environment by default
ENV NODE_ENV=production
Expand All @@ -18,6 +18,15 @@ RUN mkdir -p /var/lib/kutt
# copy the rest of source files into the image
COPY . .

# switch back to node 22 for running the app
FROM node:22-alpine

# set working directory.
WORKDIR /kutt

# copy built application from build phase
COPY --from=build_image /kutt ./

# expose the port that the app listens on
EXPOSE 3000

Expand Down

0 comments on commit 5c6a337

Please sign in to comment.