In a small create-react-app project, I'm experiencing pretty abysmal download times for our bundle.js file when running through Docker.
When react-scripts start
is run locally I'm seeing 1.4 seconds for a freshly compiled bundle download:
When run through Docker via Docker Compose I'm seeing 1.4 minutes for a freshly compiled bundle download:
One thing to note -- The compilation step when running through Docker completes quickly enough, but it is this download process at the browser that is so slow.
This seems crazy to me. I have a good deal of Docker experience and I expect applications to run slower when running via Docker due to abstracting to a VM, particularly frontend applications, but not by a full order of magnitude.
Googling around and searching the create-react-app issues hasn't provided me any leads on what would be causing this issue.
A little bit more about my Docker environment -- Here is our Docker compose entry for the frontend service:
frontend:
environment:
- CHOKIDAR_USEPOLLING=true
image: node:8
volumes:
- ../frontend:/app
working_dir: /app
command: "/bin/sh -c 'npm start'" # This runs `react-script start`
external_links:
- api
ports:
- "3008:3008"
Looking for somewhere to start debugging this as my google-fu failed.