From c8f5032ea5a308c61c41b7b91b11621deca3f974 Mon Sep 17 00:00:00 2001 From: messi-ashish10 Date: Sat, 22 Nov 2025 00:38:27 -0500 Subject: [PATCH] Add Docker support: Dockerfile, .dockerignore, README updates --- .dockerignore | 34 ++++++++++++++++++++++++++++++++++ Dockerfile | 12 ++++++++++++ README.md | 18 ++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..38ea5b0b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,34 @@ +# Ignore node modules +node_modules + +# Ignore build output +.next +out + +# Ignore local env files +.env +.env.local +.env.*.local + +# Ignore logs +npm-debug.log +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Ignore Git +.git +.gitignore + +# Ignore Dockerfile itself? +Dockerfile + +# Ignore OS-specific files +.DS_Store + +# Ignore editor settings +.vscode +.idea + +# Ignore caches +.next/cache diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..085cd664 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:20-alpine AS builder +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build + +FROM node:20-alpine AS runner +WORKDIR /app +COPY --from=builder /app ./ +EXPOSE 3000 +CMD ["npm", "start"] \ No newline at end of file diff --git a/README.md b/README.md index d7e08ca5..c46d82ae 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,24 @@ You can start editing the page by modifying `app/(public)/page.js`. The page aut This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Outfit](https://vercel.com/font), a new font family for Vercel. +--- +## Docker + +You can run GoCart using Docker withou installing Node.js locally. + +#### Build the image +```bash +docker build -t gocart-app . +``` + +#### Run the container +```bash +docker run -d -p 3000:3000 gocart-app +``` + +#### Open in browser +Go to http://localhost:3000 to view the app. + --- ## 🤝 Contributing