R
Railwayβ€’17mo ago
Bordin

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
Percy
Percyβ€’17mo ago
Project ID: N/A
Bordin
BordinOPβ€’17mo ago
I dont want to post my mongodb connection string on github
Brody
Brodyβ€’17mo ago
well first I have to say, railway isn't fee
Bordin
BordinOPβ€’17mo ago
Oh I thought its free
root
rootβ€’17mo ago
You can add your environment variables in the Variables tab.
Brody
Brodyβ€’17mo ago
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
Bordin
BordinOPβ€’17mo ago
so it only hosts for a month?
Brody
Brodyβ€’17mo ago
that depends on how resource hungry your bot is
root
rootβ€’17mo ago
You can use https://docs.railway.app/develop/variables#reference-variables to hook up to a railway-provided mongodb
Railway Docs
Variables | Railway Docs
Documentation for Railway
root
rootβ€’17mo ago
although if you want low resource usage I wouldn't recommend hosting mongodb on railway
Brody
Brodyβ€’17mo ago
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
root
rootβ€’17mo ago
What language is your bot written in? that could give some idea of the resource usage
Bordin
BordinOPβ€’17mo ago
javascript discord.js Its a very small bot i dont think it will
root
rootβ€’17mo ago
Yeah, you'll probably be able to run it for a couple of months, maybe more
Brody
Brodyβ€’17mo ago
I'm in agreement with aleks
Bordin
BordinOPβ€’17mo ago
do you think i can find a better solution? a better alternative
Brody
Brodyβ€’17mo ago
than railway? not really no
root
rootβ€’17mo ago
maybe hop
Brody
Brodyβ€’17mo ago
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 πŸ™‚
root
rootβ€’17mo ago
Hop
Hop enables you to deploy and scale high-bandwidth realtime apps with ease
Brody
Brodyβ€’17mo ago
aleks 😠
root
rootβ€’17mo ago
πŸ€·β€β™‚οΈ
Brody
Brodyβ€’17mo ago
you're not a very good shill
Bordin
BordinOPβ€’17mo ago
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?
root
rootβ€’17mo ago
hop should work for that on the free plan iirc replit is more expensive, let me check yeah, currently $6.40/month
Bordin
BordinOPβ€’17mo ago
nvm ;-;
root
rootβ€’17mo ago
it says there's also a PAYG plan coming, but that's still not free honestly, I'd take a look at hop
Bordin
BordinOPβ€’17mo ago
alr, thank you btw i still dont know what to do with my .env files
Brody
Brodyβ€’17mo ago
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
Bordin
BordinOPβ€’17mo ago
Ok, thanks
Want results from more Discord servers?
Add your server