I don't know if my question is stupid but, after hours crushing my brain on it, I prefer to ask you.
I'm trying to run NPM on a Docker container (windows). I don't want a real "node server" ; I just use NPM to run utilities like gulp, webpack, browserify, vue.js...
So I added this in my ./docker-compose.yml
file :
services:
node:
build: docker/node
environment:
- NODE_ENV=dev
Until here, everything sounds good in my head.
Now here is the content of my ./docker/node/Dockerfile
:
# See https://github.com/nodejs/docker-node#dockerfile
FROM node:6
EXPOSE 8080
USER node
# set the working directory
RUN mkdir /home/node/app
WORKDIR /home/node/app
# delete existing modules and re-install dependencies
COPY package.json /home/node/app/package.json
RUN rm -rf node_modules
RUN npm install
# launch the app
# EDIT : I removed this line to solve the issue. See answer.
CMD ["npm", "start"]
To create it, I just followed official tutorials.
And then, here is my ./docker/node/package.json
file :
{
"name": "custom-symfony-project",
"version": "1.0.0",
"dependencies": {
"gulp": "^4.0.0"
},
"devDependencies": {
"gulp": "^4.0.0"
}
}
I also have 3 containers : PHP, MySQL and NGINX but they are independants and they all start correctly, so I don't thing they are the pain of the issue.
So I run my docker-compose build
: everything works fine.
But when I run docker-compose start
I got thing in my Node container logs :
npm ERR! missing script: start
I tried to add an empty server.js
but the container doesn't start.
So my question is : do I really need to start something ? Do I need a server.js ? I don't what to put into it.
When I was using npm with Ubuntu, I've just never specified a start script..!
Thanks !