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

Docker container for Nextjs without standalone build #1203

Merged
merged 2 commits into from
Nov 28, 2022

Conversation

kachar
Copy link
Member

@kachar kachar commented Nov 28, 2022

Motivation and context

Recently we've introduced frontend docker image with standalone builds, but they are not stable enough and do not provide all the needed features so the app runs smoothly.

The feature that we miss the most is reading having publicRuntimeConfig function to read the secrets from the environment (process.env). With standalone builds, the environment is being read only at build time and it brings hardcoded values to the runtime config. (link)

With this PR we roll back the change.

The docker image size in standalone mode is 263MB which was awesome, now we're back at 950+MB bringing all the node_module/ and .next folders to the final production image.

Another downside of standalone approach is that it's not yet compatible with Next 13 and app directory structure.

We're following the progress in the main Nextjs repo around these topic

@kachar kachar marked this pull request as ready for review November 28, 2022 19:02
@imilchev imilchev merged commit be4d4ff into master Nov 28, 2022
@imilchev imilchev deleted the nextjs-build-not-standalone branch November 28, 2022 19:03
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