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

Support multiple compose files #147

Open
1 task done
wjensen-godaddy opened this issue Jul 7, 2022 · 7 comments
Open
1 task done

Support multiple compose files #147

wjensen-godaddy opened this issue Jul 7, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@wjensen-godaddy
Copy link

wjensen-godaddy commented Jul 7, 2022

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Use case description

The services I need to run vary depending on the environment: local, dev, prod.

Proposed solution (optional)

It would be nice if I could have a config file for each of them, and then a way to tell serverless which one to use. Perhaps something like: serverless deploy --config=serverless-compose-dev.yml

@mnapoli
Copy link
Contributor

mnapoli commented Jul 7, 2022

@wjensen-godaddy thanks, I'm curious about your use case and whether it could be better solved with, for example, stage parameters in Compose config.

Could you share what is different between the files between dev and other stages?

@mnapoli mnapoli added the enhancement New feature or request label Jul 7, 2022
@wjensen-godaddy
Copy link
Author

wjensen-godaddy commented Jul 7, 2022

@mnapoli For sure. This is what we need in prod:

# serverless-compose.yml

services:
  elastic-search:
    path: services/elastic-search

  graph:
    path: services/graph
    params:
      elasticUrl: ${elastic-search.url}

  dynamo-event-mapping:
    path: services/dynamo-event-mapping
    params:
      elasticUrl: ${elastic-search.url}
      dynamoStreamArn: ${graph.dynamoStreamArn}

And this is what we need locally and in dev:

# serverless-compose.yml

services:
  graph:
    path: services/graph

We also support spinning up a deploy for each PR. And we want to give devs the options to deploy the full stack, or the skinny version.

Like you say, maybe there's a better way to support that than multiple config files?

@pgrzesik
Copy link
Contributor

pgrzesik commented Jul 7, 2022

We've also had some proposals that you could deploy only specific services - #35
Looking at your use case, it also sounds like something that could solve the problem, correct?

@wjensen-godaddy
Copy link
Author

@pgrzesik Possibly. Although if I filtered out elastic-search, wouldn't my graph service complain that ${elastic-search.url} can't be resolved?

@pgrzesik
Copy link
Contributor

pgrzesik commented Jul 7, 2022

Oh right, I've missed that part there, thanks for correction @wjensen-godaddy 👍

@wjensen-godaddy
Copy link
Author

wjensen-godaddy commented Jul 7, 2022

Another idea I had, is when issuing service specific commands, missing dependencies could be a warning instead of an error. That way I could run sls graph:offline or sls graph:deploy.

My current workaround, is I run (cd services/graph && sls offline).

@juztinlazaro
Copy link

any news about specific compose config?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants