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

Fix: PublicRuntimeEnvironment not available in docker #661

Closed
wants to merge 3 commits into from

Conversation

dkyeremeh
Copy link

@dkyeremeh dkyeremeh commented Dec 7, 2022

Fixes #656
This PR fixes issues arising from publicRuntimeConfig not being loaded when using docker.

This issue occurs because the values of publicRuntimeConfig are generated during the build process.
This prevents the values supplied by .env files later on from taking effects.

The PR fixes this issue by supplying publicRuntimeConfig to the nextApp when it is loaded by server/server.js

@@ -1,4 +1,4 @@
FROM node:12-alpine
FROM node:lts-alpine
Copy link
Author

Choose a reason for hiding this comment

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

Updated node

Comment on lines +15 to +17
# Remove Env variables from container before building
RUN rm -rf .env

Copy link
Author

Choose a reason for hiding this comment

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

Removing .env from the docker image during build process. This is to prevent local .env during development from being used for publicRuntimeConfig

const app = nextApp({
dir: "./client",
dev: env.isDev,
conf: { publicRuntimeConfig }
Copy link
Author

@dkyeremeh dkyeremeh Dec 7, 2022

Choose a reason for hiding this comment

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

Add publicRuntimeConfig to nextApp from express

@dkyeremeh dkyeremeh changed the title Master Fix: PublicRuntimeEnvironment not available in docker Dec 7, 2022
@dkyeremeh dkyeremeh closed this Dec 7, 2022
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.

Not show the homepage with options if anonymous links disabled
1 participant