hello world with flask and redis using docker networking
Yes, it's absolutely reasonable and this is how real apps work. This is the microservice approach which allows to independently scale instances of a service and a DB.
What you have to do is to run your Flask and Redis services in a way so the first one can achieve the second one. If they are on the same machine, you just have to open Redis port used by your Flask app (probably 6379):
docker run -d -p 192.168.10.20:6379:6379 your_redis_image

And specify IP address and port of the Redis container in your Flask app. This is better to be done with a config file like the following yaml:
redis:
  host: '172.16.10.20'
  pw: 'YourPassWord'
  port: 6379
  db: 0

And use it in the code:
import yaml, redis

cfg_file open('config.yaml', 'r')
cfg = yaml.load(cfg_file)
redcfg = cfg['redis']

r = redis.Redis(
    host=redcfg['host'], port=redcfg['port'],
    db=redcfg['db'], password=redcfg['pw'],
)

Don't forget to copy this file into container to be accessible from the inside.