From cfc10fe5025bb0c3cd82d6172d8aa48c8ea91ca0 Mon Sep 17 00:00:00 2001 From: Pawan Kumar <39653409+dheeth@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:41:36 +0530 Subject: [PATCH 1/4] Added dockerfile for containerization --- Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f14757b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Use an official Node.js runtime as a parent image +FROM node:16.20.2-alpine + +# Set the working directory in the container +WORKDIR /app + +# Install required binaries +RUN apk update && apk add git autoconf automake gcc build-base + +# Copy the package.json file +COPY package*.json yarn.lock ./ + +# Install the dependencies +RUN yarn install --network-timeout 600000 + +# Copy the application code +COPY . . + +RUN sed -i -e '78,99d' components/Navigator.tsx + +# Build the Next.js application for production +RUN yarn && yarn build + +# Expose port 3000 +EXPOSE 3000 + +# Run the Next.js production server +CMD ["yarn", "start"] From c7c869428b1ad24c02e10ed4118f2301001a9993 Mon Sep 17 00:00:00 2001 From: Pawan Kumar <39653409+dheeth@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:42:39 +0530 Subject: [PATCH 2/4] Changed workdir in dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f14757b..f1aa1bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM node:16.20.2-alpine # Set the working directory in the container -WORKDIR /app +WORKDIR /transform # Install required binaries RUN apk update && apk add git autoconf automake gcc build-base From 51a3bd50192067482eb9e4ad17d41bc4283100e1 Mon Sep 17 00:00:00 2001 From: Pawan Kumar <39653409+dheeth@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:43:00 +0530 Subject: [PATCH 3/4] Fixed dockerfile --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f1aa1bd..4b8cdad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,6 @@ RUN yarn install --network-timeout 600000 # Copy the application code COPY . . -RUN sed -i -e '78,99d' components/Navigator.tsx - # Build the Next.js application for production RUN yarn && yarn build From 879b87ccfb4019d9d6a2bf3becf78cb20dce86f6 Mon Sep 17 00:00:00 2001 From: Pawan Kumar <39653409+dheeth@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:46:35 +0530 Subject: [PATCH 4/4] Added instructions to run using docker in readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c3355c1..942a0e1 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ MIT @ Ritesh Kumar ## Self Hosting - You can self-host the project by running `yarn && yarn build && yarn start` +- You can also use docker to build and run transform using `docker build -t transform . && docker run -d --name transform -p 3000:3000 transform` ## Contributors