Hi,
Some general info first. I am starting on a new project, to be deployed in a docker swarm
. I already played with phoenix, but just when I got used to it a bit, 1.3 came out, and throws me off track. Also I feel like I am continuously needing to research a lot (even to keep up with things) and cannot actually start because of that.
I’ve looked at a few videos on 1.3, contexts, umbrellas, and read some discussions about them, but these only left me more confused. So I decided to just go look for advice from the community.
My application involves two public websites, a few internal (admin) sties, one public API with Oauth2, and a few internal APIs (only reachable inside the swarm). microservices if you will.
Now my questions are about structuring code and directories, umbrellas and deployment. Looking for best practices, and not: ‘anything is possible, depending on how you want to structure it’ answers.
QUESTIONS:
Looking at my use case, should I create an umbrella project and create separate apps for each website, and each api?
Can apps inside an umbrella project be deployed separately? Can they be deployed together? Are there recipes for that, or do I (again) need to research it? If I deploy containers, should I deploy the entire umbrella project into every container and just activate the application I need to use for that container? Or create separate containers for each app.
I’ve seen two ways to create umbrella projects, mix phx.new xxx --umbrella
and mix new xxx --umbrella
. They differ greatly in files generated. Which one would be best in my case?
Examples on the net mention --sup
to generate a supervisor tree. Would that be useful in my case?
Can I even host multiple websites on one Phoenix instance? If so how?
Can I directly call into another application in the same umbrella (is the code living in the same root namespace) or do I need to consume the API it publishes?
Thanks for any insights,
– Ron