Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: reduce docker image size by using multistage and Next.js standalone build for frontend image #407

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SGhotra1
Copy link

@SGhotra1 SGhotra1 commented May 8, 2024

Reducing Docker Image Size of Frontend Image

Issue: #237

Description

The image size of the Docker image for the frontend was about 1.6 GB on my machine.
Using a multistage build in the Dockerfile and the Next.js standalone build feature this was brought down to 210 MB.
For the standalone build to work the static and public files had to be copied into the build directory.

Copy link
Collaborator

@NearW NearW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have to test this manually, otherwise LGTM

packages/frontend/package.json Outdated Show resolved Hide resolved
packages/frontend/Dockerfile Outdated Show resolved Hide resolved
@SGhotra1 SGhotra1 force-pushed the tech/237/reduce_docker_image_sizes branch from 3f160ca to 468e626 Compare May 29, 2024 09:33
@NearW NearW force-pushed the tech/237/reduce_docker_image_sizes branch from 468e626 to c0b9106 Compare June 26, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants