Open JCMais opened 5 years ago
@JCMais Thanks for pointing this out. I'll investigate this solution.
@JCMais I finally got some time to test your approach on GKE and it worked perfectly and it's definitely much cleaner so I'll try to push with an update soon.
Glad it worked 😄
Yea, I need to start using initContainer. I haven't started using it yet. I was going to on my next project. Thanks for the example!
It's better doing it that way because it's not necessary to wait for the files to become available (as seen here: https://github.com/SocketCluster/socketcluster/blob/5226c2a/sample/dockerwait.js).
Example of how it would work:
The container is only started when the init container has finished. I was using that until recently, having both as normal containers can cause some problems, and having to set the wait timeout to bigger values each time newer dependencies are added.
Recently I've ditched this deployment in favor of building my own socketcluster image with the correct dependencies already installed, since copying
node_modules
from the image to the volume was taking too long (almost 20 mins). But it's here as a suggestion.