Skip to content

Commit ced550a

Browse files
committed
switch to node:22-slim to realize most of the size improvements while not sacraficing debugging ability
1 parent a7c9f62 commit ced550a

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

alfalfa_web/Dockerfile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22 AS base
1+
FROM node:22-slim AS base
22
ARG GIT_COMMIT
33
ENV GIT_COMMIT=$GIT_COMMIT
44

@@ -15,7 +15,7 @@ COPY alfalfa_web /srv/alfalfa
1515

1616
ARG NODE_ENV
1717
RUN npm run build
18-
CMD [ "npm", "start" ]
18+
CMD [ "node", "build/index.js" ]
1919

2020
# **** Staged build for running in development mode ****
2121
FROM base AS dev
@@ -26,10 +26,4 @@ FROM base AS dev
2626
WORKDIR /srv/alfalfa
2727

2828
# Run in watch mode so it will automatically restart
29-
CMD [ "npm", "run", "watch" ]
30-
31-
FROM gcr.io/distroless/nodejs22-debian12:latest as production
32-
COPY --from=base /srv/alfalfa /srv/alfalfa
33-
WORKDIR /srv/alfalfa
34-
35-
CMD [ "build/index.js" ]
29+
CMD [ "npm", "run", "watch" ]

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
# is to utilize shared code, specifically in db
77
dockerfile: alfalfa_web/Dockerfile
88
context: .
9-
target: production
9+
target: base
1010
args:
1111
- NODE_ENV
1212
image: ${REGISTRY_BASE_URI}/web:${VERSION_TAG}

0 commit comments

Comments
 (0)