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

Allow an app's .terra.yml file to override or extend the generated docker-compose.yml #21

Open
jonpugh opened this issue Jul 1, 2015 · 5 comments

Comments

@jonpugh
Copy link
Member

jonpugh commented Jul 1, 2015

The .terra.yml file could have something like this

compose_file: docker-compose.yml

or

compose:
  redis:
    image: redis
  app:
    links:
    -  redis

which would automatically merge with the generated compose.yml file.

Feedback welcome.

This was referenced Jul 1, 2015
@xendk
Copy link
Contributor

xendk commented Jul 1, 2015

I'd suggest just using the docker-compose.yml file if it exists.

We'd still need the option of setting it in the .terra.yml file in case you want to use a different file name. And setting it to null ("~") could make terra ignore a project docker-compose.yml and fall back its own.

@jonpugh
Copy link
Member Author

jonpugh commented Jul 3, 2015

First use case was to add a container linked to the app container, I've successfully added code to do this:

docker-compose:
  app_services:
    redis:
      image: redis

Because we need to always link these addon services to the app container, I called the property app_services. These are added directly to the docker-compose.yml file, and the service is linked to the app container automatically.

There's still more work to do to allow apps to totally override their docker setup. I welcome others to help on this, as it's not a priority for me at this point.

@xendk
Copy link
Contributor

xendk commented Jul 8, 2015

I was reminded recently that docker doesn't require microservices. One might as well run everything in one container. Which might be a bit of an advantage if one's using containers designed to be as close to an existing production environment as possible.

Maybe the concept of environment templates is something that'll be needed at some point?

@jonpugh
Copy link
Member Author

jonpugh commented Jul 8, 2015

Absolutely. I'd like the EnvironmentFactory to be completely swappable actually, so users wouldn't even have to use docker.

Just needs work to get there.

The flip side is, that I'd like for the default to be scalable. Once you are locked into a single container, it's hard to get out.

@jonpugh
Copy link
Member Author

jonpugh commented Jul 14, 2015

I've gotten this working for attaching services to the app container automatically.

It is not able to fully override docker-compose yet.

See https://github.com/terra-ops/terra-app/blob/master/docs/.terra.yml#L29 for an example .terra.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants