Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,32 @@ In root
npm run dev
```

### **2️⃣ Docker Setup**
1. **For Client**
- **Build**
```
docker build -t raktconnect-client .
```
- **Run**
```
docker run -p 5173:5173 raktconnect-client
```
2. **For Server**
- **Build**
```
docker build -t raktconnect-server .
```
- **Run**
```
docker run -p 3000:3000 raktconnect-server
```

3. **For whole project**
```
docker-compose up --build
```


## 📝 License

This project is licensed under the [MIT License](LICENSE).
Expand Down
1 change: 1 addition & 0 deletions client/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
21 changes: 21 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Import the base Node.js image
FROM node:20-alpine

# Set working directory
WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm install && \
npm install react-helmet-async

# Copy app source
COPY . .

# Expose the port the app runs on
EXPOSE 5173

# Start the development server
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"react-router-dom": "^7.6.2",
"react-toastify": "^11.0.5",
"recharts": "^2.15.1",
"sweetalert2": "^11.17.2",
"sweetalert2": "^11.6.13",
"tailwindcss": "^4.0.6"
},
"devDependencies": {
Expand Down
45 changes: 45 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: '3.8'

services:
# Backend Service
server:
build:
context: ./server
dockerfile: Dockerfile
container_name: raktconnect-server
restart: always
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- MONGODB_URI=${MONGODB_URI}
- JWT_SECRET=${JWT_SECRET}
volumes:
- ./server:/usr/src/app
- /usr/src/app/node_modules
networks:
- raktconnect-network

# Frontend Service
client:
build:
context: ./client
dockerfile: Dockerfile
container_name: raktconnect-client
restart: always
ports:
- "5173:5173"
environment:
- VITE_API_URL=http://localhost:5000
volumes:
- ./client:/app
- /app/node_modules
- /app/.vite
depends_on:
- server
networks:
- raktconnect-network

networks:
raktconnect-network:
driver: bridge
Loading