ReactJs is downloading packages really slow on server

I have a reactjs application that is taking a really long time to download the packages on server. When I run it with npm run dev locally, the same package with 11.6mb locally takes 0.7s while on the server is taking 11 minutes.

All my routes are already with lazy loads, I don’t know what it can be. I am running in a docker container with the same npm run dev. The same vm is running my backend service and it is working fine.

I’ll put my package.json and vite.config.js below.

{
  "name": "dashboard-front",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "files": [
    "dist"
  ],
  "main": "./dist/my-lib.umd.cjs",
  "module": "./dist/my-lib.js",
  "exports": {
    ".": {
      "import": "./dist/my-lib.js",
      "require": "./dist/my-lib.umd.cjs"
    }
  },
  "scripts": {
    "dev": "vite --host",
    "build": "vite build",
    "lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
    "preview": "vite preview"
  },
  "dependencies": {
    "@turf/turf": "^6.5.0",
    "axios": "^1.2.1",
    "date-fns": "^2.29.3",
    "dotenv": "^16.0.3",
    "firebase": "^9.21.0",
    "mapbox-gl": "^2.15.0",
    "plotly.js-dist-min": "^2.24.2",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-hook-form": "^7.41.5",
    "react-icons": "^4.8.0",
    "react-map-gl": "^7.0.25",
    "react-modal": "^3.16.1",
    "react-plotly.js": "^2.6.0",
    "react-query": "^3.39.3",
    "react-router-dom": "^6.10.0",
    "react-select": "^5.7.3",
    "react-sliding-side-panel": "^2.0.3",
    "react-svg": "^16.1.12",
    "react-table": "^7.8.0",
    "react-toastify": "^9.1.3",
    "styled-components": "^5.3.6"
  },
  "devDependencies": {
    "@types/react": "^18.0.28",
    "@types/react-dom": "^18.0.11",
    "@vitejs/plugin-react": "^4.0.0",
    "eslint": "^8.38.0",
    "eslint-plugin-react": "^7.32.2",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.3.4",
    "vite": "^4.3.2",
    "vite-plugin-fast-react-svg": "^0.4.0"
  }
}
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { svgPlugin } from "vite-plugin-fast-react-svg";

export default defineConfig({
  plugins: [
    react(),
    svgPlugin()
  ],
  server: {
    host: true,
    port: 3000,
    cors: false,
    watch: {
      usePolling: true
    }
  },
  preview: {
    host: 'localhost',
    port: 5000,
    strictPort: true,
    cors: false
  },
  build: {
    chunkSizeWarningLimit: 1000 * 500,
    rollupOptions: {
      output: {
        manualChunks(id) {
          if (id.includes('node_modules')) {
            return 'vendor';
          }
        },
      },
    },
  },
})