Reputation: 166
I`m trying to crate web app on docker container and i have one question: What is more preferable way to keep application up-to-date if there is some changes(new commit in repo for example)?
I have 2 options for now:
Do clone from repo and another actions in Dockerfile. Cool but i need to rebuild image every time when i add some changes to source code.
Deploy my application on container start (with some shell script for example). Its may require more time to start, but no need to rebuild image.
Which way better for you or maybe there is more simple option and i missing it?
Thank you.
Upvotes: 2
Views: 229
Reputation: 1029
The first way is much better.
Your docker image should contain all application dependencies or compiled binary of application without making any additional preparation on container startup.
Just setup CI process to build and push docker image on any code change.
Upvotes: 2