Require: bun
docker build . -t binance-bot
Port forward: PC_WEBHOOK_PORT
= 3000
to 3001
docker rm -f binance-bot
docker run --init -dit -p 3000:3001 --name binance-bot binance-bot:latest
Stop
docker kill binance-bot
Make sure internal_port
match, currently using --local-only
for faster build time, can switch to --remote-only
fly deploy --local-only && fly scale count 1
Deploy the bot with the supported port on ipv4: 443
, 80
, 88
, 8443
; Add a domain name;
Add 149.154.160.0/20
and 91.108.4.0/22
to accept incoming subnet
Add SSL/TLS support
Make a POST request to https://api.telegram.org/bot<token>/setWebhook
async function setWebhook(token, url = "") {
// Default options are marked with *
const response = await fetch(`https://api.telegram.org/bot${token}/setWebhook`, {
method: "POST",
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: url
}),
});
return response.json();
}
- Use
Fly.io volume storage
- Use
elysiajs
instead offastify