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

Update docker build #31

Merged
merged 6 commits into from Sep 27, 2022
Merged

Update docker build #31

merged 6 commits into from Sep 27, 2022

Conversation

samfry13
Copy link
Owner

This overhauls the environment variables mostly.

The reason for this, is Next.js is designed in a way that environment variables are set at build time, this can be worked around somewhat when using docker, but the issue is client variables. By default, Next.js replaces the code with the strings themselves. This makes it almost impossible to have dynamic environment variables for the client when running in docker.

The workaround I'm using dynamically loads new environment variables into a JS script, and then on the frontend, loading that script in on every page.

It's annoying, but it works.

Also in this PR:

  • various small fixes and tweaks to code

@samfry13 samfry13 merged commit 1ba6a23 into main Sep 27, 2022
@samfry13 samfry13 deleted the update-docker-build branch September 27, 2022 23:51
This was referenced Sep 27, 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.

None yet

1 participant