Skip to content

Commit

Permalink
add production docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
jchartrand committed Dec 3, 2024
1 parent aec9e61 commit 1ca631f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:18 as builder
ADD . /app
ENV NODE_ENV=production
WORKDIR /app
RUN npm install

FROM gcr.io/distroless/nodejs18-debian11
COPY --from=builder /app/node_modules /app/node_modules
COPY --from=builder /app/server.js /app/server.js
COPY --from=builder /app/src /app/src
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/healthcheck.js /app/healthcheck.js

# The healthcheck can be run from here, but also from the compose file
# HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD ["/nodejs/bin/node", "app/healthcheck.js"]

CMD ["app/server.js"]

EXPOSE 4009

2 changes: 1 addition & 1 deletion Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:20
WORKDIR /app
COPY . .
RUN npm install
#RUN npm install
CMD ["node", "server.js"]
EXPOSE 4009

0 comments on commit 1ca631f

Please sign in to comment.