简体   繁体   English

使用Docker容器查询AWS RDS实例

[英]Using a docker container querying an AWS RDS Instance

I am developing an application that is going to be deployed using a docker container. 我正在开发一个将使用docker容器部署的应用程序。 This app connect and queries a Aurora database on AWS RDS. 该应用程序连接并查询AWS RDS上的Aurora数据库。

I would like to make some QA tests, pointing to test database instead of Aurora db production. 我想进行一些QA测试,指向测试数据库而不是Aurora db生产。

What is the best approach? 最好的方法是什么?

Create a database replica on the same RDS ? 在同一RDS上创建数据库副本?

Put and MySQL instance inside the app container and point to it, and make the QA tests? 将MySQL实例放在应用容器中并指向它,然后进行质量检查?

Or create a simple container with MySQL installed and points my app to it? 还是创建一个安装了MySQL的简单容器并将我的应用程序指向它?

Put and MySQL instance inside the app container 将MySQL实例放入应用容器

That is generally not advised, as a container is supposed to represent a service in a fixed state, and should not change during runtime. 通常不建议这样做,因为容器应该以固定状态表示服务,并且在运行时不应更改。

create a simple container with MySQL installed and points my app to it? 创建一个安装了MySQL的简单容器并将我的应用程序指向它?

That is closer, although, if possible, I would again not change the existing running app container, but launch a new app one, with --link to a test MySQL container. 这就更接近了,尽管,如果可能的话,我不会再更改现有的正在运行的应用程序容器,而是使用--link链接到测试MySQL容器来启动一个新的应用程序容器。
That way, you keep separate whatever prod runtime environment from your test environment. 这样,您可以将任何产品运行时环境与测试环境分开。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM