DiscordBot Deployment
Hi! I made a discord bot with a database and i want to deploy it for free since it is just a small project, I heard railway is a good place to look into . I tried deploying from github but then i remembered I have a gitignore that removes .env files which caused the deployment to crash.
How can I avoid this issue?
30 Replies
Project ID:
N/A
I dont want to post my mongodb connection string on github
well first I have to say, railway isn't fee
Oh
I thought its free
You can add your environment variables in the Variables tab.
you get a free trial, but that only gives you a one time credit of 5$
and yeah what aleks said, have a look at these docs
https://docs.railway.app/develop/variables
so it only hosts for a month?
that depends on how resource hungry your bot is
You can use https://docs.railway.app/develop/variables#reference-variables to hook up to a railway-provided mongodb
although if you want low resource usage I wouldn't recommend hosting mongodb on railway
since railway is usage based.
if your app is resource efficient, you could run your bot for a few months.
or if your bot uses a lot of resources you would chew through those 5$ fast
What language is your bot written in? that could give some idea of the resource usage
javascript
discord.js
Its a very small bot i dont think it will
Yeah, you'll probably be able to run it for a couple of months, maybe more
I'm in agreement with aleks
do you think i can find a better solution?
a better alternative
than railway? not really no
maybe hop
you get 5$ on the trial plan, run your bot for as long as you can and see if you like the platform, if you like railway upgrade to the hobby plan once you run of of trial credits π
Hop
Hop enables you to deploy and scale high-bandwidth realtime apps with ease
aleks π
π€·ββοΈ
you're not a very good shill
It's a very small project, i dont really want to spend money on it as I am not the owner, and the owner wouldn't spend money
can I host on replit?
hop should work for that on the free plan
iirc replit is more expensive, let me check
yeah, currently $6.40/month
nvm ;-;
it says there's also a PAYG plan coming, but that's still not free
honestly, I'd take a look at hop
alr, thank you
btw
i still dont know what to do with my .env files
nothing, keep them in your gitignore and store the variables in the railway service variables
me and aleks have both sent links to documentation, please read them
Ok, thanks