HISTORY LOG
Микросервис HookahPixel_bot на базе FastAPI.
STRUCTURE
Hookah_bot /
├── Dockerfile
├── server.py
└── static /
└── index.html
> VIEW INDEX.HTML
VIEW server.py
@app.get("/api/send-tele")
def send_notification():
message = "🔥 Срочно в кальянную!"
url = f"https://api.telegram.org/bot{TOKEN}/sendMessage"
payload = {"chat_id": CHAT_ID, "text": message}
return requests.post(url, json=payload).json()
VIEW Dockerfile
FROM python:3.10-slim
WORKDIR /app
RUN pip install fastapi uvicorn requests
COPY . .
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "80"]
DEPLOYMENT CMD
docker build -t kirillpixel/hookah-bot .
docker run -d -p 5060:80 --name hookah-pixel kirillpixel/hookah-bot
← Вернуться в HUB.KIRILL