在Google云容器中pipe理预configuration

我有一个使用Firebase作为数据库的Nodejs,React应用程序。 为了构build应用程序,我正在使用webpack。 我目前正在使用dockerfile,我已经在master分支上build立了一个构build触发器。 这是我目前的设置。

现在,问题在于configurationpipe理。 我想有两个不同的环境,“舞台”和“生产”。 两者都应该指向单独的firebase实例。 在准备构build之前,我怎样才能做到这一点,我可以下载正确的configuration,分段或生产,然后build立容器?

我曾经尝试过:

我有一个docker文件,它在构build之前从google存储中下载configuration文件:

FROM node:6.11.1 # Installing yarn and pm2 RUN npm i -g yarn --silent RUN yarn global add pm2 --silent WORKDIR /app COPY . /app # Copy the config files. RUN apt-get update; apt-get install curl RUN curl -sS --fail -o config/config.js https://storage.googleapis.com/envvars-xxx/config.prod.js RUN curl -sS --fail -o config/firebase.config.js https://storage.googleapis.com/envvars-xxx/firebase.config.prod.js # RUN yarn install && yarn upgrade RUN rm -rf node_modules && yarn --silent # Build project RUN yarn build-prod # Start the server CMD ["pm2-docker", "dist/main.js"] 

每当我推动一些东西来掌握,在生产项目中生成一个构build。 每当我在任何分支中推送某个东西时,都会在分段项目中生成一个构build。

正如你可以在docker文件中看到的,我不能改变基于env的URL。 在Google云端实现这个目标的最好方法是什么? 我是这个空间的新手。

谢谢 :)