You need to tweak the amount of workers and the DB buffer. So, the options you would need to tweak would be:
db_shared_buffers
UNICORN_WORKERS
Here you can see the estimates of usage per Unicorn
Discourse is able to run with 512MB of RAM its not a good experience but it’s possible. You issue is that Discourse reviews the server (as the whole node) resources and plans the resource usage to take advantage of as most resources as possible because Discourse makes the assumption it will run alone.