Sharing Baked-In Data

I have the need for:

  • An application server service
  • A reverse proxy service
  • Site code & assets

I think it’s probably going to be most appropriate to bake the code & assets into the app service image; however, the reverse proxy will serve the static assets directly (static and dynamic assets coexist in the code base).

In other words, the reverse proxy will need to access data from the app service.

I haven’t found how to do this. I think a shared volume won’t be appropriate, because it seems the app server should be the source of truth and it should disappear when the container disappears.

Others have asked similar questions, but I haven’t seen decent answers. (IIRC, one person gave up and put both the reverse proxy and the app in the same image.) Maybe we’ve got our approach backwards; maybe it doesn’t make sense. If that’s the case, please explain what the right approach actually is.


I think the answer always comes back to: Combine your reverse proxy and app server on one image.

That doesn’t seem to be in the spirit of microservices. I think I could probably make something work with a network share in the container with the source data and autofs in the container that needs to share that data, but that’s convoluted.

I think I smell a missing Docker feature (mounting one container’s baked-in data from another container). Am I wrong? I’m interested in hearing counter-arguments.