简体   繁体   中英

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.

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?

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?

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)

So, you should have two dockerfiles total.

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

For the nginx, that first link shows a dotnet core and react app with nginx and has the deployment strategy I've described. 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.

Hope this helps. I can clarify more if needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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