Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions generators/app/templates/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
node_modules
Dockerfile
12 changes: 12 additions & 0 deletions generators/app/templates/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:<%= elementNodeVersion %>-alpine as builder
WORKDIR /app
COPY . .
RUN yarn && yarn build && yarn purge && yarn --production

FROM node:<%= elementNodeVersion %>-alpine
RUN apk add --no-cache curl
WORKDIR /app
COPY --from=builder /app/build build
COPY --from=builder /app/node_modules node_modules
HEALTHCHECK --interval=30s --timeout=30s --retries=3 CMD curl --fail http://${HOST}:${PORT}/health || exit 1
CMD ["node", "build/index.js"]