I am running node js official image inside Docker container and I noticed that the npm start command takes a lot longer to start than when it's outside of Docker.
Are there settings that I can change to make it run faster? Perhaps allocating more memory to the container?
For reference I will paste relevant files below.
Dockerfile:
FROM node:8.1
WORKDIR var/www/app
# Global install yarn package manager
RUN apt-get update && apt-get install -y curl apt-transport-https && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y yarn
RUN npm install -g create-react-app
The command I use to start my container:
docker run --rm -ti \
--link api-container:api \
--name my-container -p 3000:3000 \
-v $(pwd):/var/www/app nxmohamad/my-container \
bash
and the start script is just NODE_PATH=. react-scripts start