Use launcher to build the image and launch it with the env variables needed to make it work. You can get them with a launcher command that shows just the startup call (look at launcher code to get it).
You can either build it against the live database and then launch it, or build it against a temporary database and then migrate and precompile assets after you launch.
All of that is beyond the scope of support available here.
Or you could use bitnami (also not supported here).