CyCoreSystems / docker-meteor

Dockerfile and script for running Meteor on Docker
MIT License
120 stars 73 forks source link

Error: listen EACCES 0.0.0.0:80 #41

Closed ecerroni closed 7 years ago

ecerroni commented 7 years ago

I'm getting the following error when launching the container with:

sudo docker run --rm   -e ROOT_URL=http://testsite.com   -v $(pwd):/home/meteor/src   -e MONGO_URL=mongodb://172.17.0.2:27017/appdb   ulexus/meteor

ERROR:

Starting Meteor Application...
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: listen EACCES 0.0.0.0:80
    at Object.exports._errnoException (util.js:907:11)
    at exports._exceptionWithHostPort (util.js:930:20)
    at Server._listen2 (net.js:1237:19)
    at listen (net.js:1286:10)
    at net.js:1395:9
    at nextTickCallbackWith3Args (node.js:469:9)
    at process._tickCallback (node.js:375:17)
Ulexus commented 7 years ago

That is correct; now that Meteor does not allow running as root, you may not bind to port 80. With a container, that should not normally be a problem. Just set the PORT environment variable to some other port (>1024), and Meteor will bind to that port instead. If you wish Docker to expose that port as port 80 externally, you may do so easily, as well.

In your case, I would modify your execution thus:

docker run --rm \
  -e MONGO_URL=mongodb://172.17.0.2:27017/appdb \
  -e ROOT_URL=http://testsite.com \
  -e PORT=3000 \
  -p 80:3000 \
  -v $(pwd):/home/meteor/src \
  ulexus/meteor
ecerroni commented 7 years ago

I see. It worked like a charm!