[Service] Type=simple User=youruser WorkingDirectory=/path/to/bot ExecStart=/usr/bin/python3 /path/to/bot/bot.py Restart=always
# Add handlers application.add_handler(CommandHandler("start", start)) application.add_handler(CommandHandler("help", help_command)) application.add_handler(CommandHandler("cancel", cancel)) application.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, handle_url)) application.add_handler(CallbackQueryHandler(button_callback)) application.add_error_handler(error_handler)
COPY bot.py .
COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt
