teamniteo / pyramid-realworld-example-app

Pyramid and OpenAPI3 based RealWorld implementation.
https://realworld.io
MIT License
43 stars 21 forks source link

[opinions] Use docker-compose? #72

Open sayanarijit opened 5 years ago

sayanarijit commented 5 years ago

There are some lengthy docker commands in the Makefle e.g. https://github.com/niteoweb/pyramid-realworld-example-app/blob/master/Makefile#L28 https://github.com/niteoweb/pyramid-realworld-example-app/blob/master/Makefile#L34 https://github.com/niteoweb/pyramid-realworld-example-app/blob/master/Makefile#L39

Docker compose let's us define the default properties of all the containers in a yaml file so that the management commands become clean and minimal.

Docker compose also comes with several other goodies such as workspace specific network, auto unique container names etc. to avoid conflicting with other docker containers on the dev's machine.

It's also easy to run and debug containers with docker compose as no container has to be put in the background and all can print outputs in a single session on the terminal.

So I think it will be beneficial to use docker compose instead of raw docker commands. Opinions?

sayanarijit commented 5 years ago

Example: How docker compose is being used in warehouse: https://github.com/pypa/warehouse/blob/master/docker-compose.yml

zupo commented 5 years ago

Is there something else I need to install? As long as the "API" of make commands don't change and I don't have to tell people to install yet another dependency, I don't mind.

If, however, there are extra roadblocks for people to set up the env, then the benefits must vastly outweigh the cons (which in this case, is longer onboarding).

sayanarijit commented 5 years ago

There's no extra dependency in mac and windows i.e. machines running "docker machine". Since docker is native to linux and doesn't need "docker machine" to be installed, installing docker-ce won't install docker-compose. So we have to instruct linux users to install docker-compose. Is that okay?

sayanarijit commented 5 years ago

Other api and make targets should stay the same.

sayanarijit commented 5 years ago

Example instructions: https://warehouse.readthedocs.io/development/getting-started/#install-docker-compose

zupo commented 5 years ago

Not ideal, but I do see the benefits. Could you please prepare a PR so we can all see how it would look?