I also could not find a listener in your code. Is there something in the code that is binding to port 8080? Which file specifies this port (not including fly.toml)?
I am deploying a Telegram anti-spam bot using Fly.io and my app starts successfully, but the machine stops a few seconds after startup. I am using flyctl deploy for deployment (not GitHub actions).
Here are the key details:
The .env file was previously in the GitHub repository, but I have since deleted it.
I am using fly secrets set BOT_TOKEN=… for my secret environment variable.
My code now includes an aiohttp web server listening on port 8080 as expected by Fly.io:
app = web.Application()
async def health_check(request):
return web.Response(text=“Bot is running”)
app.router.add_get(“/”, health_check)
…
site = web.TCPSite(runner, ‘0.0.0.0’, 8080)
await site.start()
Thank you for the suggestion. I will make sure to use proper Markdown formatting (for Python and TOML) in future messages when possible. You’re right, my previous message was sent via email, which doesn’t support Markdown formatting well. I appreciate your guidance.
@karol594 I invite you to fix this one, on this occasion. Next to every post is a pencil icon, and if you click it, you get full editing facilities.
Getting formatting right isn’t just a case of making your posts easier to read. The above formats, like YAML, will not work if their indentation is incorrect. So, readers will not spot this category of error if you hide it.