From 74ce7e2084d4d0747fcd25d24f5ca473f9a9fac8 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Tue, 18 Jan 2022 15:43:48 +0000 Subject: [PATCH] Add 'Dockerfile' --- Dockerfile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..70188ce --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM node:14-buster AS build + +# Set working directory and node user +WORKDIR /home/node/lowdefy + +RUN chown node:node /home/node/lowdefy + +USER node + +# Copy app config and change ownership of files to "node" user +COPY --chown=node:node . . + +# Build the Lowdefy config using the Lowdefy CLI +RUN npx lowdefy@3.23.2 build + +# Use the correct Lowdefy base image +FROM lowdefy/lowdefy:3.23.2 + +# Copy build output from build stage +COPY --from=build --chown=node:node /home/node/lowdefy/.lowdefy/build ./build + +# Copy contents of public directory into image +COPY --chown=node:node ./public ./public + +# Run the server on start +CMD ["node", "./dist/server.js"] \ No newline at end of file