在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云端实现这个目标的最好方法是什么? 我是这个空间的新手。
谢谢 :)
- 从docker运行HSQL服务器启动时的默认脚本
- 无法从本地主机连接到Docker中的MySQL(Docker for Mac beta)
- Docker中的Xdebug在PhpStorm中不起作用
- 卡夫卡在docker工人不工作
- Docker缺lesslog4net ConsoleAppender日志
- 使用Confluent.Kafka从.net核心服务写入Kafka
- 使用Kafka,Zookeeper和MongoDB Dockerize Spring Boot Java应用程序
- 使用mysql-client从Alpine Docker映像内部通过SSL连接到Amazon RDS。 并validation证书
- 我怎样才能重新使用远程API“docker运行”?