diff --git a/README.md b/README.md index a887642..bc9aca6 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,53 @@ Check the design in [Figma](https://www.figma.com/design/WQnt0qRFSdaV3jW5XF8NSc/
## 🛠️ Getting Started + +### With Docker +1. **Clone the repository** + +```sh + git clone https://github.com/Satyam1923/Spring.git +``` + +### For Backend +1. **Navigate to the backend folder** +```sh +cd backend +``` +2. **Build Docker Image** +```sh +docker build -t : . +``` +3. **Run Docker Image** +```sh +docker run -p 3030:3030 : +``` +4. **Access it locally** + +Go to http://localhost:3030/ + + +### For Frontend +1. **Navigate to the frontend folder** + +```sh +cd frontend +``` +2. **Build Docker Image** +```sh +docker build -t : . +``` +3. **Run Docker Image** +```sh +docker run -p 3000:3000 : +``` +4. **Access it locally** + +Go to http://localhost:3000/ + + +### Without Docker + 1. **Clone the repository** ```sh diff --git a/backend/.dockerignore b/backend/.dockerignore new file mode 100644 index 0000000..76add87 --- /dev/null +++ b/backend/.dockerignore @@ -0,0 +1,2 @@ +node_modules +dist \ No newline at end of file diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..316906f --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,13 @@ +FROM node:16-alpine + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +EXPOSE 3030 + +CMD ["npm", "start"] \ No newline at end of file diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..76add87 --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,2 @@ +node_modules +dist \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..47248a3 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,15 @@ +FROM node:16-alpine + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +RUN npm run build + +EXPOSE 3000 + +CMD ["npm", "run", "preview"] \ No newline at end of file diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 5bb6d1f..4d0cdf6 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -5,4 +5,9 @@ import react from "@vitejs/plugin-react"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + + preview: { + host: true, + port: 3000 + } });