且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用docker-compose将环境变量设置到docker容器中

更新时间:2021-08-16 23:18:46

在创建此问题时,我已经以一种有趣而又简单的方式解决了这个问题,但是我一直认为我发布了答案

While creating this question I have been resolve this problem in a funny and easy way but I have been thought that I post answer to help someone in the future with similiar problem.

您要做的就是删除下一个 = 签名,因此docker-compose.yml的最后两行应如下所示:

环境:
-GOOGLE_APPLICATION_CREDENTIALS = / usr / src / app / CryptoTraderBot- 901d31d199ce.json

All you have to do is remove " " (space) next = sign so two last lines of docker-compose.yml should looks like this: environment: - GOOGLE_APPLICATION_CREDENTIALS=/usr/src/app/CryptoTraderBot-901d31d199ce.json