The bitnami image isn’t maintained or recommended by us, so I’m afraid it’s tricky to help here. We always recommend following our standard install guide, which is regularly tested on small machines (1GB RAM + 2GB swap).
If you must stick with the bitnami image, then I’d recommend checking you’re on the latest version of Discourse. There have been a few improvements to memory requirements & build speed over the last year or so.