简体   繁体   English

Rails,Ember,Redis,nginx和docker

[英]Rails, Ember, Redis, nginx and docker

Colleagues, I have a front-end application based on Ember and Rails (running on nginx) which also uses redis as a cache. 同事们,我有一个基于Ember和Rails(在nginx上运行)的前端应用程序,它也使用redis作为缓存。

I want to dockerize this application, but not sure about best practices. 我想将此应用程序停靠,但不确定最佳实践。 Would it be best to create one container with a dockerfile that pulls in all these pieces, or should each component be in its own container? 是否最好创建一个带有dockerfile的容器,这个容器可以存入所有这些部分,或者每个组件应该都在自己的容器中?

For bonus points: I have to retrieve the code from private bitbucket repos and.. how are we meant to store our secrets and other config files when using containers? 对于奖励积分:我必须从私人bitbucket repos中检索代码,并且......在使用容器时,我们如何存储我们的秘密和其他配置文件?

So, I'll try my best from a phone, 所以,我会用手机尽我所能,

Secrets are to be kept in environment variables, so you may need to update your application code to work with those. 秘密将保存在环境变量中,因此您可能需要更新应用程序代码以使用它们。

As for dockerizing, I typically do backend (rails in this case) in one (or more) container(s) and nginx in a single container bundled with a single page app (ember in this case) 至于dockerizing,我通常在一个(或多个)容器中执行后端(在这种情况下为rails),并在与单个页面应用程序捆绑的单个容器中执行nginx(在本例中为ember)

So, you should have two dockerfiles total. 所以,你应该有两个dockerfiles。

Here are some resources that hopefully provide enough to get started: 以下是一些有望开始提供的资源:

Dotnet + react: https://github.com/sillsdev/appbuilder-portal/ Modern bleeding edge ember: https://gitlab.com/NullVoxPopuli/emberclear/ Old ember: https://gitlab.com/precognition-llc/aeonvera-ui Rails: https://gitlab.com/precognition-llc/aeonvera Dotnet +反应: https//github.com/sillsdev/appbuilder-portal/现代流血的余烬: https ://gitlab.com/NullVoxPopuli/emberclear/ Old ember: https ://gitlab.com/precognition-llc/ aeonvera-ui Rails: https//gitlab.com/precognition-llc/aeonvera

For the nginx, that first link shows a dotnet core and react app with nginx and has the deployment strategy I've described. 对于nginx,第一个链接显示了一个dotnet核心,并将应用程序与nginx做出反应,并且具有我所描述的部署策略。 For nginx, you'll start with a node container, or the ember-cli image from danlynn (who still hasn't responded to me about getting those on the official ember docketed), and use multistage builds to eventually copy your dist folder to a directory in the nginx container in the last stage. 对于nginx,你将从一个节点容器开始,或者来自danlynn的ember-cli图像(他还没有回复我关于将这些文件放到官方的ember上),并使用多级构建最终将你的dist文件夹复制到最后一个阶段的nginx容器中的目录。

Hope this helps. 希望这可以帮助。 I can clarify more if needed. 如果需要,我可以澄清更多。

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

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