Adding this environment variable in the Dockerfile solved the issue
ENV NEXT_PRIVATE_STANDALONE true
Add this before the build step