defang
defang copied to clipboard
Generate with multiple samples (mixin)
I think it would be really cool if we could merge multiple samples. I think one of the barriers during the hackathon was that there's a nextjs sample and a flask sample, but they aren't tied together. So if you want a Next.js frontend and a Flask backend you need to understand compose files and Dockerfiles so you can pick what's necessary from each.
I think that's fine for the more experienced devs that we're going to offer Defang to in the future. But for more junior devs, that might be a bit to much to ask of them.
I think if we carefully structure our samples to match a particular format, we can probably make it relatively easy to merge multiple samples together. It might just be about making sure that the samples have:
- compose files in the root
- either a single compose.yaml file or a compose.yaml and a compose.dev.yaml file
- any services in subdirectories that match the service name in the compose files
I think that as long as those two things are true, we can relatively easily merge the configurations. There might be some stuff to figure out around naming services in compose.dev.yaml
files...