如何解决docker-compose中的String Interpolate环境变量
我有以下docker-compose.yml文件:
locat.string="3444 South texas"
AttributeError: 'NoneType' object has no attribute 'string'
秘密“ StripeSecretKey”指向文本文件,其秘密密钥为:
我正在尝试将我的秘密密钥值插入到stripe-cli容器的命令集合中。但是我无法使用上述语法来做到这一点。
在执行上述docker-compose文件时,我收到以下警告:
version: '3.6'
services:
stripe-cli:
image: stripe/stripe-cli:latest
container_name: stripe-cli
secrets:
- StripeSecretKey
environment:
StripeSecretKey: /run/secrets/StripeSecretKey
command: --api-key ${StripeSecretKey} listen --forward-to http://localhost:5000/api/payment/webhook
secrets:
StripeSecretKey:
file: ./secrets/StripeSecretKey.txt
我会很感激。
解决方法
尝试这样
environment:
STRIPE_API_KEY: /run/secrets/StripeSecretKey
command: listen --forward-to http://localhost:5000
https://stripe.com/docs/cli/api_keys 您可以设置两个环境变量,它们优先于所有其他值:
STRIPE_API_KEY: the API key to use for the CLI.
STRIPE_DEVICE_NAME: the device name for the CLI,visible in the Dashboard.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。