Python code support

Hello! I was wondering if is it possible to host a Discord bot made in Python here, on Cloudflare. I need someone to reply telling me if this is possible, and if it is, how to do it, or what service to use. There are some things that will probably necessary (necessary, not necessary but good to have), such as: - Python 3.9+ - Pip: to install some packages, such as discord, requests, shuttleai, google.generativeai, sqlite3, psutil, flask (read next section). - ~50mb storage: or more, but that should be enough. - SSH: to check the built-in logs that the code has, if something goes wrong. - Linked to a domain/subdomain The bot also hosts a website at 0.0.0.0 (any) using a Flask server, which is also built-in, and can be disabled if it isn't possible to have it linked to a domain or a sub-domain.
3 Replies
Chaika
Chaika5mo ago
Quick answer: No, not with those requirements Cloudflare has Workers which can be used for http interaction bots. But Workers are V8 Isolates, like Chrome tabs/web environment, they don't have any built in storage, the max code limit is 10 MB for Paid, trying to run a gateway bot would require a constant connection which can sort of be done with Durable Objects but I don't think anyone has, too expensive. It sounds like you're more looking for a vps or discord bot hosting, neither of which Cloudflare offers
Jotalea
Jotalea5mo ago
Ok, no problem. I'll search for something else. Any suggestions?
Chaika
Chaika5mo ago
Depends what you are looking for. If you were comfortable with managing your own linux server/vps, Hetzner Cloud is cheap and reliable in my experience. Otherwise not sure for more managed offerings