4GB 스왑 설정에도 재구축 시 메모리 부족 오류가 발생합니다

You have a lot of swap but a great deal is already in use. As a two container setup has less downtime, perhaps it’s true that the current invocation of the server is still running and has clocked up a lot of memory use perhaps due to a leak.

Perhaps a restart would help, before the update. Perhaps measure swap use before and after the restart.