Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

New config on Heroku #758

Closed
chevinbrown opened this issue May 26, 2017 · 8 comments
Closed

New config on Heroku #758

chevinbrown opened this issue May 26, 2017 · 8 comments

Comments

@chevinbrown
Copy link

chevinbrown commented May 26, 2017

When using heroku with the following config, I still get the error Web process failed to bind to $PORT within 60 seconds of launch

const CONFIG = {
    headless: true,
    api: {
        host: '0.0.0.0',
        port: process.env.PORT || 3000,
    },
    ui: {
        ssl: true,
        host: 'heroku-appy-name.herokuapp.com',
        port: 443,
        path: '/'
    },
    adapter: 'sqlite'
}

Using a procfile

web: node gekko --config sample-config.js

Scouring the web trying to understand why this wont work (tried 3000 as a string also).

Anything I can do to help?

@askmike
Copy link
Owner

askmike commented May 26, 2017

The command you posted does not start the gekko UI, and thus nothing that Heroku calls a "Web process". The CLI version of Gekko is a script that keeps running forever, but Heroku is meant for "webservices".

So: You should be able to use the UI on heroku (untested, but I don't see why not). But you cannot run the commandline version on Heroku.

@askmike askmike closed this as completed May 26, 2017
@chevinbrown
Copy link
Author

Even still, starting the web process web: node gekko --ui gives me nothing. I'm assuming that I need to start the API on 3000 and the web-ui on heroku's port?

@askmike
Copy link
Owner

askmike commented May 26, 2017

Here some context:

When using the UI gekko starts a server, which the frontend (webpage) will connect to:

[ UI ] ---> [ gekko server ]

In the UI config those are split up since if you want to run Gekko in the cloud and you want to secure the gekko server so that other people do not have access to this server. You can do this by putting a reverse proxy between the two components:

[ UI ] ---> [ reverse proxy ] ---> [ gekko server ]

In this reverse proxy you can configure SSL and BasicAuth (or whatever you want really) so that no one can access the gekko server.

This setup is not possible on Heroku (AFAIK), so the only thing you can do is the basic setup above. For the basic setup you configure the api and the UI to use the same port / host / no SSL.

@chevinbrown
Copy link
Author

That's what I thought ^.
To summarize: There should be no issue running the UI on heroku, but it will need the gekko server hosted somewhere else?

@askmike
Copy link
Owner

askmike commented May 26, 2017

I think you can run everything on heroku, example config:

const CONFIG = {
    headless: true,
    api: {
        host: 'heroku-appy-name.herokuapp.com',
        port: 3000,
    },
    ui: {
        ssl: false,
        host: 'heroku-appy-name.herokuapp.com',
        port: 3000,
        path: '/'
    },
    adapter: 'sqlite'
}

And you point your browser to: http://heroku-appy-name.herokuapp.com:3000. This is under the assumption that you can use port 3000 on heroku (I have no idea). You cannot use port 443 since that is for SSL traffic which you can only do with a reverse proxy (gekko does not support it directly).

@chevinbrown
Copy link
Author

Thanks for the help. I'll try a bit more later this weekend...would be great to host on heroku just for simplicity, but at this point I'll probably use a private server. If you have the time to confirm this since you're a little more familiar with the product, it'd probably help a few more people than just me.

Thanks!

@chevinbrown
Copy link
Author

Confirmed that your proposed config does not work on heroku. I'm not sure it's possible to start both the api and the ui on heroku. Would be interested if you have success. Thank you for your help.

@isbkch
Copy link

isbkch commented Sep 21, 2017

Any news on this one ? I'm trying to set an instance on Heroku as well

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants