My container is being built but NPM commands seems to be not running.
I’m running docker-composer up app gulp
for these services:
app:
image: app_image
container_name: myapp_app
build:
context: .
dockerfile: _docker/app.Dockerfile
volumes:
- .:/var/www/html:delegated
restart: always
tty: true
networks:
- laravel
gulp:
container_name: myapp_gulp
build:
context: .
dockerfile: _docker/gulp.Dockerfile
tty: true
volumes:
- .:/var/www/html:delegated
networks:
- laravel
The gulp.Dockerfile
has:
FROM public.ecr.aws/ubuntu/ubuntu:18.04_stable
RUN apt-get update --allow-releaseinfo-change
RUN apt-get install -y build-essential
RUN apt-get install -y python2.7
ENV NODE_VERSION=11.15.0
RUN apt-get install -y curl
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
ENV NVM_DIR=/root/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
WORKDIR /var/www/html/_mytheme/tools
COPY . /var/www/html/
RUN npm install --python=python2.7
RUN npm i -y -g [email protected] --python=python2.7
RUN npm i -y [email protected] --python=python2.7
RUN npm link gulp
RUN npm rebuild node-sass --python=python2.7
RUN npm i -g yarn --python=python2.7
RUN yarn install
ENTRYPOINT ["tail"]
CMD ["-f", "/dev/null"]
After the getting containers up, the NPM directories doesn’t exists, like the npm install
command didn’t happened.
So I enter bash in container, run this command and that creates the node_modules folder fine.
Is there some reason for commands are not running?
1