heroku using gulp - no error in logs - still - heroku

I am trying to setup heroku deploy using gulp...
2015-05-31T12:39:43.160121+00:00 app[web.1]: [12:39:43] Webserver
started at http://localhost:24018
2015-05-31T12:39:43.208954+00:00
app[web.1]: [12:39:43] Finished 'serve' after 544 ms
2015-05-31T12:40:39.255239+00:00 heroku[web.1]: Error R10 (Boot
timeout) -> Web process failed to bind to $PORT within 60 seconds of
launch
2015-05-31T12:40:39.255427+00:00 heroku[web.1]: Stopping
process with SIGKILL
as per the logs webserver does get started successfully at given port.. below is how I am getting
port: process.env.PORT || 8080,
so is there any other port heroku expects application start or is there a way one can know which port heroku is checking??
note : the app does starts successfully if I do forman start web, so what can be the issue here?? though forman starts the application at a port 5000. I tried to hardcore port to 5000 but still got the same error as above...

the problem was i am using gulp-webserver which defaults to localhost, just need to change that to host: '0.0.0.0'
gulp.task('heroku', ['wiredep','inject'], function () {
return gulp.src(config.base)
.pipe(plugins.webserver({
host: '0.0.0.0',
port: process.env.PORT,
livereload: false,
open: false
}));
});

Related

DDEV: How to etablish websocket connections

I'm having some problems to establish a websocket connection to a running ddev container.
Trying wo etablish the connection per JS for example with wss://websocket.ddev.site:3000 ends always up with connection failed.
Websocket PHP library used: Ratchet (http://socketo.me/)
I tried to set the ext. container port in an own docker-compose.yaml or web_extra_exposed_ports in config.yaml but nothig worked so far.
I have managed to run a Websocket connection.
Therefore, I did an entry in config.yaml of DDEV with following Content:
web_extra_exposed_ports:
- name: ratchet
container_port: 3000
http_port: 3000
https_port: 3001
After DDEV restart, it is now possible to establish a Websocket connections with:
HTTP: 'ws://websocket.ddev.site:3000'
HTTPS: 'wss://websocket.ddev.site:3001'
My working example was build with the tutorial on http://socketo.me/docs/hello-world calling above URL with Browser console.

Gatsby on EC2 doesn't connect externally

I have a development installation of Gatsby Doc site running on my EC2 server.
When I run the code on my dev machine it works and I can connect my browser to port 8000 and everything is ok..
On my server i check out my github code and
yarn install
npm run start.
Everything builds correctly and Gatsby it listening on port 8000
From my dev machine when I connect using
X.X.X.X:8000 in my browser i receive
Unable to connect
I have opened the port on 8000 in the firewall and I have tested that it works as expected using:
nc -lv 8000
on the server (where gatsby is going to run) and connect using telnet.
on the server i receive
Listening on [0.0.0.0] (family 0, port 8000)
Connection from 84.232.Y.Y 38552 received!
So it works.
When Gatsby is finished starting i see
You can now view gatsbyjs.org in the browser. ⠀ http://localhost:8000/
⠀
when i enter the web address and port i receive
Unable to connect
again. do I need to start Gatsby in another mode?
Kim
I found out.
I just added -H 0.0.0.0 to the start up command and everything works now.

How can I expose the dynamic $PORT from Heroku in a Dockerfile?

How can I expose the dynamic $PORT from Heroku in a Dockerfile?
I push my docker container with heroku container:push web --app=... to Heroku, this works.
In there Heroku logs however I read this: heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch, I interpret this as if the port from my Dockerfile can't be exposed through Heroku.
No documentation can be found about this. How can I expose my Docker port to the Heroku port?
This is my Dockerfile:
FROM alpine:3.3
ADD binary_file .
EXPOSE 37780
CMD ["./binary_file"]
I don't think you can (isn't the port dynamic?).
I think you are supposed to use the PORT environment variable in your app (ie, your app has to bind to that port inside the container).
Supposing your app would start the python http server, your CMD should be something like this:
CMD ["sh", "-c", "/usr/bin/python -m SimpleHTTPServer ${PORT}"]

heroku console No route to host error

I have a simple Ruby app hosted on Heroku. It is not Rails app, it only uses Rack and Sinatra and it is running on cedar-14 stack.
When I try to run heroku run console or heroku run bash it prompts:
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
Error: No route to host - connect(2) (Errno::EHOSTUNREACH)
Also, when I try to telnet as suggested here It prompts just the same
$ telnet rendezvous.heroku.com 5000
Trying 50.19.103.36...
telnet: Unable to connect to remote host: No route to host
and
$ telnet s1.runtime.heroku.com 5000
telnet: could not resolve s1.runtime.heroku.com/5000: Name or service not known
I'm not premium Heroku user.
Can I get that One-Off dyno and If I can how?

Cannot connect to ghost server on ec2 instance

I am following the basic Ghost server installation on an ec2 instance, so far I can run ghost server via npm start and I can see that ghost server is up and running:
Ghost is running...
Listening on 127.0.0.1:2368
Url configured as: http://54.187.25.187/
Ctrl+C to shut down
Here is the ghost config config.js:
// ### Development **(default)**
development: {
// The url to use when providing links to the site, E.g. in RSS and email.
url: 'http://54.187.25.187/',
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost-dev.db')
},
debug: false
},
server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
}
At the end, I cannot access to anything when I type http://54.187.25.187:2368 on the browser. I really appreciate guidelines on how to setup ghost properly.
EDIT: The problem is solved already, it was a EC2 SG issue that ports remained closed after I have set them to open.
For Amazon EC2 we have found you need to change the port to 0.0.0.0
http://www.howtoinstallghost.com/how-to-setup-an-amazon-ec2-instance-to-host-ghost-for-free-self-install/

Resources