From 345f0495edb4162ec32a2e53114e2eb25356ca31 Mon Sep 17 00:00:00 2001 From: dmcdowell Date: Tue, 22 Aug 2023 09:48:55 -0600 Subject: [PATCH] updated dockerfile --- Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..18d0205 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM node:latest as builder + +WORKDIR /app + +COPY . . + +RUN yarn install --frozen-lockfile +RUN yarn build + +FROM node:alpine + +WORKDIR /app + +COPY --from=builder /app/package.json /app/yarn.lock ./ +COPY --from=builder /app/build ./ + +RUN yarn install --frozen-lockfile --production + +RUN apk add curl +HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3\ + CMD [ "curl", "--fail", "--silent", "--output", "/dev/null", "localhost:3000/api/health" ] + +EXPOSE 3000 + +CMD ["node", "./index.js"] \ No newline at end of file