I run the official node js image inside the Docker container, and I noticed that the npm launch command runs much longer than when it is outside of Docker.
Are there any settings that I can change to make it work faster? Perhaps allocating more memory to the container?
For reference, I will embed the appropriate files below.
Dockerfile:
FROM node:8.1
WORKDIR var/www/app
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 that I use to start my container is:
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 beginning of the script is just NODE_PATH=. react-scripts start
source
share