fargate icon indicating copy to clipboard operation
fargate copied to clipboard

Allow for docker-file inheritance

Open mchastain-turner opened this issue 5 years ago • 4 comments

As a user of the fargate command I would like to be able to deploy my different environments using an inheritance/override model that is allowed with the docker-compose command.

eg: fargate service deploy --service foo --cluster bar -f docker-compose.yml -f docker-compose.dev.yml

https://github.com/turnerlabs/fargate/pull/57

mchastain-turner avatar Jul 27 '20 15:07 mchastain-turner

Just curious, what problem does the "inheritance/override model" solve for you? Is it sharing environment variables?

jritsema avatar Jul 27 '20 19:07 jritsema

could be environment variables or env files. The default yaml could have default env var or env-files and each environment could inherit and override that without copy and paste. It is also useful for shared x-fargate-secrets just to stop the need for copy/paste.

mchastain-turner avatar Jul 27 '20 19:07 mchastain-turner

Ok, yeah was going to say that you could use env_file for that.

dev.yml

web:
  env_file:
    - shared.env
    - dev.env

prod.yml

web:
  env_file:
    - shared.env
    - prod.env

jritsema avatar Jul 27 '20 20:07 jritsema

That's how we currently do it, (copy/paste style). The other piece that is nice is that this is just how docker-compose works, so it doesn't throw the surprise when it doesn't work ( like it did to me ). So you can just manage these files like normal docker-compose "compositions" vs "almost like a docker-compose behavior". It comes in handy to inherit the ports, the 'fargate.deploy' label, and probably more features could be 'composed' rather than copied around.

mchastain-turner avatar Jul 28 '20 14:07 mchastain-turner