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:
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error NPM_CONFIG_PRODUCTION=true NODE_ENV=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):
-----> 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: [] default_process_types: 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/DOKKU_PROCFILE) -----> DOKKU_SCALE file not found in app image. Generating one based on Procfile… -----> New DOKKU_SCALE 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 DOKKU_NGINX_PORT -----> Unsetting DOKKU_NGINX_SSL_PORT -----> Unsetting DOKKU_PROXY_PORT_MAP -----> Setting config vars NO_VHOST: 1 -----> no nginx port set. setting to random open high port -----> Setting config vars DOKKU_NGINX_PORT: 14275 -----> Setting config vars DOKKU_PROXY_PORT_MAP: http:14275:5000 -----> Creating http nginx.conf -----> Running nginx-pre-reload Reloading nginx -----> Setting config vars DOKKU_APP_RESTORE: 1 =====> Application deployed: http://104.236.196.140:14275
To 104.236.196.140:mavzolej
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
@hansen thanks for help)
Hi @TretjakAnton
Have a look at this tutorial to learn how to setup Node.js and Nginx: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04