Create an executable bash script somewhere which runs your python command, for me this contained
#!/usr/bin/env bash
distrobox enter cv -e ~/.virtualenvs/cv/bin/python3 "$@"
which allows me to use a virtualenv I have in my distrobox container directly. Note the "$@" at the end.
This is imperative so that commands like ... -m pip
can work.
In your config do
(setq elpy-rpc-python-command "<path-to-that-shell-script>")
And that's it. elpy will run everything through your container now.