[英]python - how to pass slack token to python app from dockerfile
我有我的 python 應用程序,我在其中通過 json 文件傳遞我的 slack 令牌。
所以我的config.json是:
{
"slack_bot_token":"xoxb-12345789",
"slack_signing_secret":"AAA23245GJ"
}
所以我的slackeventsapp.py是:
from slackeventsapi import SlackEventAdapter
from slackclient import SlackClient
import json
tokens = {}
with open('config.json') as json_data:
tokens = json.load(json_data)
EVENT_ADAPTER = SlackEventAdapter(tokens.get("slack_signing_secret"), "/slack/events")
SLACK_CLIENT = SlackClient(tokens.get("slack_bot_token"))
def PostMsg(channel, text):
SLACK_CLIENT.api_call("chat.postMessage", channel=channel, text=text)
所以我需要通過這兩個值slack_signing_secret和slack_bot_token通過dockerfile。 請幫助我們如何通過這個。
可能還有其他方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.