swagger-api / swagger-api/swagger-editor
feat(docker): specify a PUBLIC_URL/BASE_URL env var at runtime
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 9.5k
- Forks
- 2.4k
- Avg merge
- 17h 15m
- Merged PRs (30d)
- 18
Description
Hello team,
We are currently checking what is "missing" to swagger-editor v5 (compared to v4) for our Kubernetes-based deployment.
We noticed that it was not possible to set a BASE_URL (like we used to have with https://github.com/swagger-api/swagger-editor/pull/2281 for instance) at runtime through an environment variable. This was very useful for us.
Would you be open to the idea of adding this feature? This would be quite consistent with swagger-ui, see here.
We are aware of React limitations and the fact that swagger-editor v5 is also now packaged in an unprivileged fashion (so maybe this would be something only possible for privileged images).
I investigated some directions but React/WebPack/Monaco in Docker is not really a familiar setup for me. For instance, I thought about building the Docker image with a multi-stage build and by doing RUN PUBLIC_URL=__PUBLIC_URL_PLACEHOLDER__ npm run build:app but I'm not sure that it is then feasible to sed these placeholders at runtime.
Note: this issue is basically the same than https://github.com/swagger-api/swagger-editor/issues/1956 but for v5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Docker image build and runtime configuration around the mentioned build:app command, React/Webpack environment handling, and the privileged versus unprivileged image constraints. Compare the v5 setup with the referenced swagger-editor v4 change and swagger-ui's BASE_URL handling. Done means a Docker deployment can provide PUBLIC_URL or BASE_URL at runtime and the generated application uses it consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, javascript, react, webpack
- Domain
- build-system, devops, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100