chalda / DiscordBot

A chat bot for discord app based off discord.js
GNU General Public License v2.0
585 stars 354 forks source link

Not an issue, just a question #74

Closed SgtPunishment closed 8 years ago

SgtPunishment commented 8 years ago

How do I get a bot based on discord.js working on openshift.com? (I need a 100% free system to host my bot as I do not have, nor have access to a credit card, and I'm forever broke)

chalda commented 8 years ago

you can host the bot off your PC directly if you wish. seems like openshift is a docker-image based container host. Would probably need to create a docker image from discord bot. overall wouldnt even be a bad idea since it can make installing/managing dependancies a lot easier for some folks.

DerfOh commented 8 years ago

Although I haven't looked into openshift much I do know that you can host the bot from your local machine (I frequently do this to develop/test any changes on my fork before pushing to master).

The drawback to that though is that your computer would need to be on at all times to make the bot available. I have however successfully hosted from a raspberry pi too while there is an up front cost this might be the more economic rout to go if you didn't want to pay for a VPS but still maintain high availability.

Edit:

To build off of chalda's comment I have a docker image that I use to host the bot. It is definitely the way to go for a variety of reasons. If you want I can make a pull request from my fork for just the Dockerfile.

I thought there was one in this repo... at any rate here is mine there might be some light modifications you would want to make like the directory the files are stored in. Essentially to build it you can clone the original fork here and copy/paste the Dockerfile into the directory and build the image after installing the NPM dependencies.

chalda commented 8 years ago

yup i would host the bot from an RPi or even an unused machine you can keep on all the time. (a old laptop/netbook with the display disabled is a pretty cheap solution). I was gonna get around having it hosted from my pi. @Einarin hosts his from a headless linux server in his house lol. You can also do a Heroku or AWS free tier as well. In fact i should really write a heroku guide..

SgtPunishment commented 8 years ago

I don't want to host on any machines at my home, I would like a remote location in case of power issues (Bills and what not), I'm looking into heroku right now.

nmynarcik commented 8 years ago

@SgtPunishment heroku has a limitation on hours if you are not planning to pay. But I think to have it 24/7 is only $7/mth. It is a pretty cheap solution if you dont want to host locally.

chalda commented 8 years ago

@nmynarcik ah i knew Heroku curbed their free plans. i feel like chat bots always had a "here is how to deploy to heroku" guides because of how good it was. you were hardware limited but a node chat bot is super light weight.

@SgtPunishment your alternatives can also include signing up for AWS free-tier which is a 1 year free promotion. You do get charged for storage of images etc, i get periodic bills from amazon for like 57 cents. there are other free hosting solutions out there as well. I host my personal site for free from a free php host. there might be free hosts for node apps as well (hardware/bandwidth limited)

SgtPunishment commented 8 years ago

Okay, I caved in and got it up and running on my RPi (Bit of a ball ache, but it works)

nmynarcik commented 8 years ago

@chalda since writing that, Heroku changed their plans again. I now have a discord bot that runs constantly with very little down time ;)