python-telegram-bot-openshift
python-telegram-bot-openshift copied to clipboard
Starter kit for running a Telegram bot on Openshift.
trafficstars
python-telegram-bot-openshift
Starter kit for running a Telegram bot (built with the python-telegram-bot library) on Openshift.
Instructions:
- Register at Openshift. This starter kit works on Openshift online v2 and v3.
- Create a Python3 application.
- Add the following environment variables (for v2 only the TOKEN is needed):
- TOKEN: your telegram bot token
- APP_FILE: wsgi.py
- OPENSHIFT_REPO_DIR: [base dir of the project], i.e. /opt/app-root/src
- OPENSHIFT_GEAR_DNS: [domain of the app], see the hostname of the route
- OPENSHIFT_PYTHON_IP: 0.0.0.0
- OPENSHIFT_PYTHON_PORT: 8080
- Complete the
bot.pyfile with your handlers. - Put the
wsgi.pyfile at the root of your app directory tree. Thebot.pyfile can go anywhere as long as you update theimportstatement in the previous file. - Deploy everything to Openshift.