hackoregon / devops-17

deployment tools for Hack Oregon projects
4 stars 3 forks source link

Docker: which commands go where? #26

Closed MikeTheCanuck closed 7 years ago

MikeTheCanuck commented 7 years ago

Every time I sit down to figure out how to automate the build of a Docker image (container), I find myself wondering "all these special commands that my project is using - where do they go?"

There's the Dockerfile, there's docker-compose.yml, and then there's various pre-/post- commands that can be run in various places.

I'm sure that nearly anything can be done if you try hard enough, but I still haven't got a good sense of what's the generally-accepted arrangement for commands.

Giving our fellow devops engineers - not to mention developers - a clear sense of what should go in Dockerfile, and what should be initiated by docker-compose.yml, would significantly reduce the pain our peers feel in getting back to productive development.

Commands I'm thinking of include the following:

MikeTheCanuck commented 7 years ago

I have zeroed in on a working Docker + Travis solution for the Budget backend and validated it against the pattern that Dan has implemented in the backend-service-pattern.

I believe I have stripped out the redundant and inappropriate bits so that:

In the Budget team case, I have commented out the use of manage.py migrate and manage.py collectstatic since we have agreed on other ways to manage these operations.

See Budget team PR 74 for details.