Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local dev vs Defang (Prod) Configurations #292

Open
raphaeltm opened this issue Apr 20, 2024 · 4 comments
Open

Local dev vs Defang (Prod) Configurations #292

raphaeltm opened this issue Apr 20, 2024 · 4 comments
Labels
DX Affects developer experience later Low priority
Milestone

Comments

@raphaeltm
Copy link
Collaborator

We need to document the best way to run different configurations in development and production. Even things like environment variables etc. Sometimes you want to add a NODE_ENV=development in dev andNODE_ENV=production in prod. We can tell people to do something like:

defang compose up -f compose.yml -f compose.defang.yml

But that's pretty annoying.

I think it would be nice if the defang CLI looked for a *compose.defang.y*ml file by default, and if it exists, use it to override values in the main compose file.

It's not a full development workflow, but I think it's a decent starting point.

@raphaeltm raphaeltm added enhancement DX Affects developer experience labels Apr 20, 2024
@lionello lionello changed the title Dev/Prod Configurations Local dev vs Defang (Prod) Configurations Jun 26, 2024
@lionello
Copy link
Member

We added support for Compose "profile" and always have profile=defang set.

@lionello lionello added this to the Sep2024-V1 milestone Jun 26, 2024
@lionello
Copy link
Member

compose.defang.yml looks a lot like the compose.override.yml which Docker always loads automatically.

@lionello lionello modified the milestones: Sep2024-V1, July2024 Jul 8, 2024
@lionello lionello added the later Low priority label Jul 8, 2024
@lionello lionello modified the milestones: July2024, Aug2024 Aug 1, 2024
@jordanstephens
Copy link
Member

While discussing this in the office today, @lionello pointed out that local vs remote is not the same as development vs production. We want to be able to manage our configuration on all of these different axes.

I think multiple compose files are going to be necessary. Some of our samples are starting to use a pattern where the sort of remote production configuration is described in the default compose.yaml file, and a local development configuration is described in a compose.dev.yaml file which extends the default configuration, making overrides as necessary. I think this is a nice pattern as it keeps things simple for the fast demo case of writing a compose file and shipping it, but it leaves open additional space for further configuration as needs get more complex.

@raphaeltm pointed out https://github.com/DefangLabs/defang-mvp/issues/435 which describes introducing a defang dev command. I like the idea of introducing a defang local command (and maybe one day we could introduce defang remote to do development on a remote deployment). Maybe we should also have a compose.local.yaml file instead of compose.dev.yaml to stay consistent. We could use defang local to shell out to docker with something like docker compose -f compose.local.yaml, and it could even create one if it doesn't exist.

@acote88 acote88 modified the milestones: Aug2024, Sep2024 Sep 3, 2024
@lionello lionello modified the milestones: Sep2024, Oct2024 Sep 26, 2024
@Prakash-Sundaresan
Copy link
Contributor

See also DefangLabs/defang-docs#57

@lionello lionello modified the milestones: Oct2024, V1 Nov 7, 2024
@acote88 acote88 modified the milestones: V1, V2 Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Affects developer experience later Low priority
Projects
None yet
Development

No branches or pull requests

5 participants