The sample from Docker, a "hello world" with redis
and flask
, seems to build fine, but, as an exercise can it be broken into two components?
The redis service uses a public Redis image pulled from the Docker Hubregistry.
and
Compose pulls a Redis image, builds an image for your code, and startsthe services you defined. In this case, the code is statically copiedinto the image at build time.
What I have in mind is to use the default redis
image as its own container, and then modify the flask
app so that it connects to the redis
image. This is reasonable?