Comments (9)
Ah thanks for pointing this out, I wasn't aware of it.
Your command override works nicely but it looks a bit inefficient. Would this maybe solve it better? https://stackoverflow.com/a/67927521
Sorry if I wasn't clear, that wasn't a long term suggested patch, that was a patch for anyone coming across this issue. I am not sure that that Stack Overflow answer works as that would be contradictory to the explanation in the docs of as to why this occurs, I'll take a look at other solutions. But officially, the docs tell you to make an API to retrieve those values from the backend.
from bracket.
I'd do the work myself and provide a PR, but I can't get the backend to init the database, now that v1.4.3 exists I'll try again as I last tried on v.1.2.1
from bracket.
This issue came about after a040084 was made
from bracket.
Therefore, the NEXT_PUBLIC_ envs set by users of Bracket (who run Bracket using Docker) do not get evaluated during container run, as they're already "inlined" by Next.js
from bracket.
Furthermore, per the docs:
Note: After being built, your app will no longer respond to changes to these environment variables. For instance, if you use a Heroku pipeline to promote slugs built in one environment to another environment, or if you build and deploy a single Docker image to multiple environments, all NEXT_PUBLIC_ variables will be frozen with the value evaluated at build time, so these values need to be set appropriately when the project is built. If you need access to runtime environment values, you'll have to setup your own API to provide them to the client (either on demand or during initialization).
from bracket.
For the mean time, my suggested patch is to override the CMD instruction, there are various ways to do this. Our solution with docker-compose was to add the line:
services:
bracket-frontend:
command: '/bin/sh -c "yarn build && yarn start"'
from bracket.
Ah thanks for pointing this out, I wasn't aware of it.
Your command override works nicely but it looks a bit inefficient.
Would this maybe solve it better? https://stackoverflow.com/a/67927521
from bracket.
But officially, the docs tell you to make an API to retrieve those values from the backend.
Yeah that was also my initial solution but that doesn't work of course for the NEXT_PUBLIC_API_BASE_URL
variable that tells the frontend where to send requests to.
I'll take a look at other solutions
Yeah there must be a lot of projects that are selfhosted and use Next that face the same issue.
from bracket.
This looks interesting:
https://dev.to/itsrennyman/manage-nextpublic-environment-variables-at-runtime-with-docker-53dl
Additionally, the dockerfile example in that link provides a good example as to how to reduce the size of the docker images. Currently, I see that the frontend image is weighing in at 3.2GB when built.
from bracket.
Related Issues (20)
- Create FAQ / troubleshooting docs HOT 1
- Internal Server Error HOT 4
- Cannot delete a Stage HOT 1
- can't push to origin HOT 1
- [Feature Request] Implement OpenID/oauth HOT 2
- Add Docker support for arm64 architecture HOT 5
- Proposal for Enhancements to the Project HOT 1
- Issues with hosting in Kubernetes HOT 3
- Datetime issues when Postgres database has a timezone set. HOT 3
- How do rounds work in round-robin?
- Display result of a round robin round HOT 3
- Add state management to tournaments HOT 1
- Improve design of overview of matches
- Allow freezing of tournament schedule HOT 1
- Issue Switching between stages HOT 1
- Internal Server Error - Debain 12 HOT 4
- Can Bracket be used to track ELO score of multiple players? HOT 2
- Please remove CORS HOT 11
- Discrepancies between API interface StageItemWithRounds and frontend's StageItemWithRounds HOT 1
- Possible oversight when rendering Swiss matches.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bracket.