File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change 1
1
# Use the latest LTS version of Node.js
2
2
# https://hub.docker.com/_/node
3
- FROM node:22-alpine3.20@sha256:2289fb1fba0f4633b08ec47b94a89c7e20b829fc5679f9b7b298eaa2f1ed8b7e AS build-stage
3
+ FROM node:22 AS build-stage
4
4
WORKDIR /usr/src/app
5
5
6
6
# Copy package.json and package-lock.json
@@ -15,20 +15,10 @@ COPY . .
15
15
RUN npm run build
16
16
17
17
# 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
19
19
20
20
WORKDIR /usr/src/app
21
21
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
33
23
34
- CMD ["npm" , "run" , "start " ]
24
+ CMD ["server.js " ]
You can’t perform that action at this time.
0 commit comments