-
Notifications
You must be signed in to change notification settings - Fork 3
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
[ENH] Move to Docker multistage builds #450
Conversation
Reviewer's Guide by SourceryThis pull request modifies the Dockerfile to enable the injection of a custom plausible link at runtime using environment variables. It also introduces an entrypoint script to handle the replacement of placeholder values in the built application. Sequence diagram for container startup and environment variable injectionsequenceDiagram
participant User
participant Container
participant Entrypoint
participant Files
User->>Container: Start container with env vars
Container->>Entrypoint: Execute entrypoint.sh
Entrypoint->>Entrypoint: Check required env vars
alt Missing NB_API_QUERY_URL
Entrypoint-->>Container: Exit with error
else All required vars present
Entrypoint->>Files: Replace placeholders in JS/HTML
Files-->>Entrypoint: Files updated
Entrypoint->>Container: Start Nginx
end
Flow diagram for environment variable processingflowchart TD
A[Start Container] --> B{Check NB_API_QUERY_URL}
B -->|Not Set| C[Exit with Error]
B -->|Set| D[Process Files]
D --> E[Replace API URL]
E --> F[Replace Auth Settings]
F --> G[Replace Client ID]
G --> H[Replace Chatbot Settings]
H --> I[Replace Base Path]
I --> J[Replace Header Script]
J --> K[Start Nginx]
K --> L[End]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
✅ Deploy Preview for neurobagel-query ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@sourcery-ai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing this @surchs! 🧑🍳
Don't forget to add a PR label and a release label before merging. |
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.14 to 6.0.11. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v6.0.11/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Arman Jahanpour <[email protected]>
For some reason it looks like this PR didn't trigger a release as expected...not sure why |
Changes proposed in this pull request:
ENV
variables with placeholder values to the DockerfileOther note: plan is to release from this PR
NOTE: If this pull request is to be released, the release label must be applied once the review process is done to avoid the local and remote from going out of sync as a consequence of the
bump version
workflow runChecklist
This section is for the PR reviewer
[ENH]
,[FIX]
,[REF]
,[TST]
,[CI]
,[MNT]
,[INF]
,[MODEL]
,[DOC]
) (see our Contributing Guidelines for more info)skip-release
(to be applied by maintainers only)Closes #XXXX
query-tool-results
files in the neurobagel_examples repo have been regeneratedFor new features:
For bug fixes:
Summary by Sourcery
Switch the base image to
node:20-alpine
and copy the built files to annginx:alpine
image. Inject a custom plausible link to the docker container at runtime using environment variables.Build:
Deployment:
PLAUSIBLE_DOMAIN
andPLAUSIBLE_SRC
environment variables are set.Summary by Sourcery
Update the Dockerfile to use a multi-stage build, switching to
node:20-alpine
for building andnginx:alpine
for serving. Implement dynamic injection of environment variables at runtime via an entrypoint script, enabling customization of plausible link, authentication settings, and other configurations.Build:
Deployment: