diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4b8cdad --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Use an official Node.js runtime as a parent image +FROM node:16.20.2-alpine + +# Set the working directory in the container +WORKDIR /transform + +# 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 . . + +# 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"] 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