DockerIntegration - IEEE-Team-3/map GitHub Wiki

DockerIntegration

Folder Structure

  • /server: Backend Express app
  • /client: Frontend React-Vite app
  • /docker: Docker config and compose files

Dockerfile (Backend)

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 5000
CMD [ "npm", "run", "dev" ]

Dockerfile (Frontend)

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 5173
CMD ["npm", "run", "dev"]

docker-compose.yml

version: '3'
services:
  backend:
    build: ./server
    ports:
      - "5000:5000"
    volumes:
      - ./server:/app
    environment:
      - MONGO_URI=mongodb://mongo:27017/ieeeapp
  frontend:
    build: ./client
    ports:
      - "5173:5173"
    volumes:
      - ./client:/app
  mongo:
    image: mongo
    ports:
      - "27017:27017"

Notes

  • Containers are automatically rebuilt on code changes with volumes.
  • Environment variables should be handled securely via .env files or Docker secrets in production.
⚠️ **GitHub.com Fallback** ⚠️