Cant run my node.js project

June 7, 2017 472 views
Node.js Dokku Ubuntu

i'm trying to run my application with dokku.
I add Procfile with "web: node server.js" to the root of directory, and run server.js contains "app.listen(app.get('port'), function () { console.log('Server started at port:' + app.get('port') + '/');});". In dokku logs i have Server started at port: 5000. But on my ip + :5000 - is nothing, and ip+ :14275 is nothing too.
Below i wright dokker command "git push dokku master
" out put:

  • git push dokku master Counting objects: 488, done. Delta compression using up to 8 threads. Compressing objects: 100% (344/344), done. Writing objects: 100% (488/488), 4.34 MiB | 316.00 KiB/s, done. Total 488 (delta 237), reused 236 (delta 109) -----> Cleaning up... -----> Building mavzolej from herokuish... -----> Setting config vars CURLCONNECTTIMEOUT: 5 -----> Setting config vars CURLTIMEOUT: 30 -----> Adding BUILDENV to build environment... -----> Node.js app detected

-----> Creating runtime environment

NPMCONFIGLOGLEVEL=error
NPMCONFIGPRODUCTION=true
NODEENV=production
NODE
MODULES_CACHE=true

-----> Installing binaries
engines.node (package.json): 4.1.2
engines.npm (package.json): ^4.1.2

Downloading and installing node 4.1.2...
Resolving npm version ^4.1.2 via semver.io...
Downloading and installing npm 4.6.1 (replacing version 2.14.4)...

-----> Restoring cache
Skipping cache restore (new runtime signature)

-----> Building dependencies
Pruning any extraneous modules
Installing node modules (package.json)
mavzolej@1.0.0 /tmp/build
+-- body-parser@1.17.2
| +-- bytes@2.4.0
| +-- content-type@1.0.2
| +-- debug@2.6.7
| | -- ms@2.0.0
| +-- depd@1.1.0
| +-- http-errors@1.6.1
| | +-- depd@1.1.0 deduped
| | +-- inherits@2.0.3
| | +-- setprototypeof@1.0.3 deduped
| |
-- statuses@1.3.1 deduped
| +-- iconv-lite@0.4.15
| +-- on-finished@2.3.0
| | -- ee-first@1.1.1
| +-- qs@6.4.0
| +-- raw-body@2.2.0
| | +-- bytes@2.4.0 deduped
| | +-- iconv-lite@0.4.15 deduped
| |
-- unpipe@1.0.0
| -- type-is@1.6.15
| +-- media-typer@0.3.0
|
-- mime-types@2.1.15
| -- mime-db@1.27.0
+-- express@4.15.3
| +-- accepts@1.3.3
| | +-- mime-types@2.1.15 deduped
| |
-- negotiator@0.6.1
| +-- array-flatten@1.1.1
| +-- content-disposition@0.5.2
| +-- content-type@1.0.2 deduped
| +-- cookie@0.3.1
| +-- cookie-signature@1.0.6
| +-- debug@2.6.7 deduped
| +-- depd@1.1.0 deduped
| +-- encodeurl@1.0.1
| +-- escape-html@1.0.3
| +-- etag@1.8.0
| +-- finalhandler@1.0.3
| | +-- debug@2.6.7 deduped
| | +-- encodeurl@1.0.1 deduped
| | +-- escape-html@1.0.3 deduped
| | +-- on-finished@2.3.0 deduped
| | +-- parseurl@1.3.1 deduped
| | +-- statuses@1.3.1 deduped
| | -- unpipe@1.0.0 deduped
| +-- fresh@0.5.0
| +-- merge-descriptors@1.0.1
| +-- methods@1.1.2
| +-- on-finished@2.3.0 deduped
| +-- parseurl@1.3.1
| +-- path-to-regexp@0.1.7
| +-- proxy-addr@1.1.4
| | +-- forwarded@0.1.0
| |
-- ipaddr.js@1.3.0
| +-- qs@6.4.0 deduped
| +-- range-parser@1.2.0
| +-- send@0.15.3
| | +-- debug@2.6.7 deduped
| | +-- depd@1.1.0 deduped
| | +-- destroy@1.0.4
| | +-- encodeurl@1.0.1 deduped
| | +-- escape-html@1.0.3 deduped
| | +-- etag@1.8.0 deduped
| | +-- fresh@0.5.0 deduped
| | +-- http-errors@1.6.1 deduped
| | +-- mime@1.3.4
| | +-- ms@2.0.0 deduped
| | +-- on-finished@2.3.0 deduped
| | +-- range-parser@1.2.0 deduped
| | -- statuses@1.3.1 deduped
| +-- serve-static@1.12.3
| | +-- encodeurl@1.0.1 deduped
| | +-- escape-html@1.0.3 deduped
| | +-- parseurl@1.3.1 deduped
| |
-- send@0.15.3 deduped
| +-- setprototypeof@1.0.3
| +-- statuses@1.3.1
| +-- type-is@1.6.15 deduped
| +-- utils-merge@1.0.0
| -- vary@1.1.1
+-- formidable@1.1.1
+-- mysql@2.13.0
| +-- bignumber.js@3.1.2
| +-- readable-stream@1.1.14
| | +-- core-util-is@1.0.2
| | +-- inherits@2.0.3 deduped
| | +-- isarray@0.0.1
| |
-- string_decoder@0.10.31
| -- sqlstring@2.2.0
+-- nodemailer@4.0.1
+-- react@15.5.4
| +-- fbjs@0.8.12
| | +-- core-js@1.2.7
| | +-- isomorphic-fetch@2.2.1
| | | +-- node-fetch@1.7.1
| | | | +-- encoding@0.1.12
| | | | |
-- iconv-lite@0.4.15 deduped
| | | | -- is-stream@1.1.0
| | |
-- whatwg-fetch@2.0.3
| | +-- loose-envify@1.3.1 deduped
| | +-- object-assign@4.1.1 deduped
| | +-- promise@7.1.1
| | | -- asap@2.0.5
| | +-- setimmediate@1.0.5
| |
-- ua-parser-js@0.7.12
| +-- loose-envify@1.3.1
| | -- js-tokens@3.0.1
| +-- object-assign@4.1.1
|
-- prop-types@15.5.10
| +-- fbjs@0.8.12 deduped
| -- loose-envify@1.3.1 deduped
+-- react-dom@15.5.4
| +-- fbjs@0.8.12 deduped
| +-- loose-envify@1.3.1 deduped
| +-- object-assign@4.1.1 deduped
|
-- prop-types@15.5.10 deduped
+-- react-google-maps@6.3.0
| +-- babel-runtime@6.23.0
| | +-- core-js@2.4.1
| | -- regenerator-runtime@0.10.5
| +-- can-use-dom@0.1.0
| +-- google-maps-infobox@1.1.15
| +-- invariant@2.2.2
| |
-- loose-envify@1.3.1 deduped
| +-- lodash@4.17.4
| +-- marker-clusterer-plus@2.1.4
| +-- react-display-name@0.2.0
| +-- react-prop-types-element-of-type@2.2.0
| +-- scriptjs@2.5.8
| -- warning@3.0.0
|
-- loose-envify@1.3.1 deduped
+-- react-redux@4.4.8
| +-- create-react-class@15.5.3
| | +-- fbjs@0.8.12 deduped
| | +-- loose-envify@1.3.1 deduped
| | -- object-assign@4.1.1 deduped
| +-- hoist-non-react-statics@1.2.0
| +-- invariant@2.2.2 deduped
| +-- lodash@4.17.4 deduped
| +-- loose-envify@1.3.1 deduped
|
-- prop-types@15.5.10 deduped
+-- react-router@2.8.1
| +-- history@2.1.2
| | +-- deep-equal@1.0.1
| | +-- invariant@2.2.2 deduped
| | +-- query-string@3.0.3
| | | -- strict-uri-encode@1.1.0
| |
-- warning@2.1.0
| | -- loose-envify@1.3.1 deduped
| +-- hoist-non-react-statics@1.2.0 deduped
| +-- invariant@2.2.2 deduped
| +-- loose-envify@1.3.1 deduped
|
-- warning@3.0.0 deduped
+-- react-router-bootstrap@0.23.3
| -- prop-types@15.5.10 deduped
+-- react-router-dom@4.1.1
| +-- history@4.6.1
| | +-- invariant@2.2.2 deduped
| | +-- loose-envify@1.3.1 deduped
| | +-- resolve-pathname@2.1.0
| | +-- value-equal@0.2.1
| |
-- warning@3.0.0 deduped
| +-- loose-envify@1.3.1 deduped
| +-- prop-types@15.5.10 deduped
| -- react-router@4.1.1
| +-- history@4.6.1 deduped
| +-- hoist-non-react-statics@1.2.0 deduped
| +-- invariant@2.2.2 deduped
| +-- loose-envify@1.3.1 deduped
| +-- path-to-regexp@1.7.0
| |
-- isarray@0.0.1 deduped
| +-- prop-types@15.5.10 deduped
| -- warning@3.0.0 deduped
+-- react-router-redux@4.0.8
-- redux@3.6.0
+-- lodash@4.17.4 deduped
+-- lodash-es@4.17.4
+-- loose-envify@1.3.1 deduped
`-- symbol-observable@1.0.4

-----> Caching build
Clearing previous node cache
Saving 2 cacheDirectories (default):

  • node_modules
  • bower_components (nothing to cache)

-----> Build succeeded!
+-- body-parser@1.17.2
+-- express@4.15.3
+-- formidable@1.1.1
+-- mysql@2.13.0
+-- nodemailer@4.0.1
+-- react@15.5.4
+-- react-dom@15.5.4
+-- react-google-maps@6.3.0
+-- react-redux@4.4.8
+-- react-router@2.8.1
+-- react-router-bootstrap@0.23.3
+-- react-router-dom@4.1.1
+-- react-router-redux@4.0.8
`-- redux@3.6.0

addons: []
defaultprocesstypes:
web: npm start
-----> Discovering process types
Procfile declares types -> web
-----> Releasing mavzolej (dokku/mavzolej:latest)...
-----> Deploying mavzolej (dokku/mavzolej:latest)...
-----> Attempting to run scripts.dokku.predeploy from app.json (if defined)
-----> App Procfile file found (/home/dokku/mavzolej/DOKKUPROCFILE)
-----> DOKKU
SCALE file not found in app image. Generating one based on Procfile...
-----> New DOKKUSCALE file generated
=====> web=1
-----> Attempting pre-flight checks
For more efficient zero downtime deployments, create a file CHECKS.
See http://dokku.viewdocs.io/dokku/deployment/zero-downtime-deploys/ for examples
CHECKS file not found in container: Running simple container check...
-----> Waiting for 10 seconds ...
-----> Default container check successful!
-----> Running post-deploy
-----> Attempting to run scripts.dokku.postdeploy from app.json (if defined)
=====> renaming container (7b941e088c6b) kickass
jones to mavzolej.web.1
=====> no global VHOST set. disabling vhost support
-----> Unsetting mavzolej
-----> Unsetting DOKKUNGINXPORT
-----> Unsetting DOKKUNGINXSSLPORT
-----> Unsetting DOKKU
PROXYPORTMAP
-----> Setting config vars
NOVHOST: 1
-----> no nginx port set. setting to random open high port
-----> Setting config vars
DOKKU
NGINXPORT: 14275
-----> Setting config vars
DOKKU
PROXYPORTMAP: http:14275:5000
-----> Creating http nginx.conf
-----> Running nginx-pre-reload
Reloading nginx
-----> Setting config vars
DOKKUAPPRESTORE: 1
=====> Application deployed:
http://104.236.196.140:14275

To 104.236.196.140:mavzolej

  • [new branch] master -> master
2 Answers
Node.js is an open source JavaScript runtime environment for easily building server-side and networking applications. Node.js applications can be run at the command line but this guide focuses on running them as a service using PM2, so that they will automatically restart on reboot or failure, and can safely be used in a production environment.
Have another answer? Share your knowledge.