version: '3.8'

services:
  backend:
    build: ./backend
    ports:
      - "5000:5000"
    # environment:
    #   - MONGO_URI=mongodb://mongo:27017/portfolio
    #   - JWT_SECRET=your_jwt_secret
    volumes:
      - ./backend:/usr/src/app
    depends_on:
      - mongo

  frontend:
    build: ./frontend
    ports:
      - "5173:5173"
    volumes:
      - ./frontend:/usr/src/app
    command: npm run dev

  mongo:
    image: mongo:latest
    ports:
      - "27017:27017"
    volumes:
      - mongo-data:/data/db

volumes:
  mongo-data:
