Skip to content

Commit 9a83997

Browse files
committed
fix: changed production image to (maybe) fix sodium error
1 parent 1b6943a commit 9a83997

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

Dockerfile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Use the latest LTS version of Node.js
22
# https://hub.docker.com/_/node
3-
FROM node:22-alpine3.20@sha256:2289fb1fba0f4633b08ec47b94a89c7e20b829fc5679f9b7b298eaa2f1ed8b7e AS build-stage
3+
FROM node:22 AS build-stage
44
WORKDIR /usr/src/app
55

66
# Copy package.json and package-lock.json
@@ -15,20 +15,10 @@ COPY . .
1515
RUN npm run build
1616

1717
# The same image but now only install the production dependencies as the frontend is already built using vite in the build-stage
18-
FROM node:22-alpine3.20@sha256:2289fb1fba0f4633b08ec47b94a89c7e20b829fc5679f9b7b298eaa2f1ed8b7e AS production
18+
FROM gcr.io/distroless/nodejs22-debian12 AS production
1919

2020
WORKDIR /usr/src/app
2121

22-
# copy over package.json from the origin file system again so it can be done in parallel from docker (if configured)
23-
COPY package*.json ./
24-
# install only dependencies which are not marked as dev
25-
RUN npm ci --omit=dev
26-
27-
# copy over necessary files for the server
28-
COPY server.js ./
29-
COPY server server
30-
31-
# copy over precompiled frontend
32-
COPY --from=build-stage /usr/src/app/dist dist
22+
COPY --from=build-stage /usr/src/app /usr/src/app
3323

34-
CMD ["npm", "run", "start"]
24+
CMD ["server.js"]

0 commit comments

Comments
 (0)