Just at a quick glance, you don’t need a data container if you are using named volumes, so I highly suggest you skip it. Also, if resources are meant to be shared/interact, they should be in the same Compose file, not multiple ones.
You’re correct! In this case the data container download about 2 Mo so I’m ok to use it in the same compose file, but other data-container are much bigger. That why I experiment using two compose files.
Also, you don’t use the bindmount notation if the volume is named. name:/foo:/bar is invalid (it doesn’t make sense – named volumes are meant to be shared between containers but not from host <=> container).
Also, you don’t use the bindmount notation if the volume is named. name:/foo:/bar is invalid (it doesn’t make sense – named volumes are meant to be shared between containers but not from host <=> container).
Now how do I indicate to nginx to read data (it expects at /usr/share/nginx/html/) from the magic-vol:/data/get-html
Delay. I sometime download 100-200 MO in the data-ctn. I know the best thing would be to have a CICD that builds automatically images, but I like to flexibility to build from the Dockerfile.
Soon my stack will mature but now, a flexible data-ctn is my swiss knife
I have no idea what data you’re loading up, but you’re probably much better off just having some sort of service which is meant to be docker-compose runed that “seeds” the data (I’m guessing by slurping it down from an S3 bucket, the web, etc.). That way you can load it up optionally, but at any rate, I my opinion is that you should move away from baking data directly into a container image. It conflates otherwise separate concerns.
This is exactly what I’m doing (or trying to do). I decided to put both containers into the same compose v2. Previously I was messing around and thought it would be easier the debug my stack that way.
I’m curious to understand why you are affirming it (“seeds” the data) is not the case. nginx container serve files form the data-html container. My POV here, is that I don’t want to put the static files along my compose file project. I want this to be pulling at launch (from git or s3 bucket). Isn’t it separating the concerns enough?
Thanks for everything you put out there in the world. I appreciate and make those xxx+ hours spend on this worth it!