To be precise about the diagnostic, because it's worth having for next time: 137 is 128 + 9, so SIGKILL. That on its own doesn't mean OOM - you also get it when compose gives up waiting during docker stop and kills the container. The thing that told you it was OOM is the OOMKilled: true you already checked, so good instinct.
If it had been the stop-timeout case, the fix would be handling SIGTERM properly rather than touching memory at all.