gulp not running on Docker ubuntu
I checked and gulp is installed in node_packages, but when I run it from node_packages/.bin I get the same response. Running “npm” works, but running “node” appears not to work either.
Does anyone know what is going wrong?
FROM quay.io/aptible/ubuntu:14.04 # Basic dependencies RUN apt-install build-essential python-dev python-setuptools RUN apt-install libxml2-dev libxslt1-dev python-dev # PostgreSQL dev headers and client (uncomment if you use PostgreSQL) # RUN apt-install libpq-dev postgresql-client-9.3 postgresql-contrib-9.3 # MySQL dev headers (uncomment if you use MySQL) RUN apt-install libmysqlclient-dev RUN easy_install pip RUN apt-install node RUN apt-install npm # Add requirements.txt and package.json ONLY, then run pip install, so that Docker cache won't # bust when changes are made to other repo files ADD requirements.txt /app/ ADD package.json /app/ WORKDIR /app RUN pip install -r requirements.txt RUN npm install # Add repo contents to image ADD . /app/ # RUN npm install -g gulp # RUN gulp webpack:dev #django environment variables # ENV DATABASE_URL xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # ENV SECRET_KEY xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # ENV DJANGO_SETTINGS_MODULE xxxxxxxxxxxxx ENV PORT 3000 EXPOSE 3000
web: sudo node_modules/.bin/gulp webpack:dev && sudo python app/manage.py runserver 0.0.0.0:$PORT
One Solution collect form web for “gulp not running on Docker ubuntu”
Change these lines
RUN apt-install build-essential python-dev python-setuptools ... RUN apt-install node RUN apt-install npm
RUN apt-install build-essential curl python-dev python-setuptools ... RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - RUN apt-get install -y nodejs
You’ll note we added curl to your tool installation and we’re grabbing the node ppa, then installing it. This is going to give you the more current version of node on that branch. It will also come with npm, you do not need to install that separately.
Uncomment this line, as you want gulp to be a global install
# RUN npm install -g gulp
Correspondingly, in your proc file – use the global gulp