The way to build an image is following the install cloud document. You don’t want to make changes to the code by hand. You’ll need to make a plugin (but lots of stuffyou can do in a theme).
It’s possible to build an image, push it to docker hub, and run it elsewhere, but if you’re just starting auth discourse, you don’t want to do that.