David Jennings
David Jennings

Reputation: 301

Running Gulp in Docker - not found

I'm trying to create a docker-compose setup of NodeJs, Alpine, MongoDB and gulp to run typescript but I'm struggling to get gulp to run.

When running docker-compose build, I get the following:

node1_1 /bin/sh: [gulp]: not found

docker-compose.yml:

version: '3'
services:
 node1:
 build: ./node1
 ports: 
  - "3031:3031"
volumes:
  - .:/src
links: 
  - mongo
mongo:
 image: mongo
 ports: 
  - "27018:27017"
 volumes:
  - /data/mongodb/db:/data/db  

Dockerfile

FROM node:8.0-alpine
RUN mkdir -p /src
WORKDIR /src
ADD . /src

RUN apk update && apk upgrade

COPY package.json .
RUN npm install --quiet
RUN npm install gulp-cli -g 
RUN npm install gulp -D
RUN npm i gulp

EXPOSE 3031
VOLUME ["/src"]
CMD ['gulp']

Please, can someone suggest a solution?

Upvotes: 3

Views: 2713

Answers (1)

German
German

Reputation: 1695

The problem is in the link of the alpine OS commands, if you change this line of the dockerfile, it should work.

CMD gulp

Upvotes: 1

Related Questions