AI Briefing
KO

Applying the Next.js standalone option to Rallit

·2023.09.18 22:00

Key point

By applying Next.js's standalone option, Rallit reduced its Docker image size and shortened deployment time.

1 / 2

Details

Rallit, Inflab's recruitment service, had been using a heavy Docker image of about 4.67GB. To solve this, the team introduced Next.js's standalone option and carried out an optimization that extracts only the minimal code needed for the deployment environment.

Applying the standalone option generates a /standalone folder as a build output, which dramatically reduces the Docker image size and shortens push/pull times to Amazon ECR, improving overall deployment speed.

The key implementation points are as follows:

  • Monorepo handling: Solved path issues occurring in a monorepo under a Next.js v12 environment using the outputFileTracingRoot option.
  • Preload module configuration: Modules that need to be loaded before execution, such as dd-trace and pino-logger, were handled via preload.js using NODE_OPTIONS in the Dockerfile.
  • Static file management: The /static and /public folders, which are excluded during a standalone build, were copied separately to secure the resources needed for service operation.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.