Without Docker:
BOT_TOKEN=token WEBHOOK_SECRET=my-secret BASE_WEBHOOK_URL=https://my-address WEB_SERVER_PORT=my-port python main.py
- Create and activate the Virtual Python Environment.
- Install requirements
pip install -r requirements.txt
pip install -r requirements-dev.txt
- Install pre-commit hook
pre-commit install
Create the Docker image:
docker build -t telegram-bot .
You can check if the Docker image is created using docker images
command.
Run the Docker container:
docker run -p 8080:8080 --env BOT_TOKEN=telegram-bot-token --env WEBHOOK_SECRET=mysecret --env BASE_WEBHOOK_URL=mydomain.com --env WEB_SERVER_PORT=8080 telegram-bot