From a2f618a3155474d8b7846826e3af89a8ab00f307 Mon Sep 17 00:00:00 2001 From: Gaurav Jain <72644006+gjain-7@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:47:18 +0530 Subject: [PATCH] add Dockerfile (#9) --- .dockerignore | 7 +++++++ Dockerfile | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..bc2259c8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git/ +.gitignore +.next/ +.dockerignore +Dockerfile +node_modules/ +docker-compose.yml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..a8fb8278 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:alpine + +WORKDIR /usr/app + +RUN npm install --global pm2 + +COPY ./package*.json ./ + +RUN npm ci + +COPY ./ ./ + +RUN npm run build + +USER node + +CMD [ "pm2-runtime", "npm", "--", "start" ] \ No newline at end of file