| # Use an official Node runtime as a parent image | |
| FROM node:18 | |
| # Create a directory for the application | |
| WORKDIR /app | |
| # Copy the package.json and package-lock.json for both frontend and backend | |
| COPY frontend/package*.json ./frontend/ | |
| COPY backend/package*.json ./backend/ | |
| # Install dependencies for frontend | |
| WORKDIR /app/frontend | |
| RUN npm install | |
| # Install dependencies for backend | |
| WORKDIR /app/backend | |
| RUN npm install | |
| # Copy the rest of the application code | |
| WORKDIR /app | |
| COPY . . | |
| # Expose the ports | |
| EXPOSE 5173 | |
| EXPOSE 3000 | |