Skip to content

Commit

Permalink
Added option to define style config using environment variables for t…
Browse files Browse the repository at this point in the history
…he NeoDash docker image (#876)
  • Loading branch information
nielsdejong committed Apr 26, 2024
1 parent 43c9463 commit 1195ff5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
10 changes: 8 additions & 2 deletions docs/modules/ROOT/pages/developer-guide/style-configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ link:https://cdn.jsdelivr.net/npm/@neo4j-ndl/base@1.4.0/lib/tokens/css/tokens.cs

For a simple (non-Dockerized) deployment, these configuration parameters
can be changed by modifying `dist/style.config.json` after you have built the
application. When Docker image, these can not be passed as environment
variables.
application. When using the NeoDash Docker image, these can be passed as environment
variables. For example:

....
docker run -p 5005:5005 \
-e DASHBOARD_HEADER_BRAND_LOGO=https://picsum.photos/500/100 \
neo4jlabs/neodash
....

An example configuration for NeoDash

....
Expand Down
15 changes: 14 additions & 1 deletion scripts/config-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,17 @@ echo " \
\"customHeader\": \"${customHeader:=}\" \
}" > /usr/share/nginx/html/config.json

echo "${styleConfigJson:={\}}" > /usr/share/nginx/html/style.config.json
echo " \
{ \
\"DASHBOARD_HEADER_BRAND_LOGO\": \"${DASHBOARD_HEADER_BRAND_LOGO:=}\", \
\"DASHBOARD_HEADER_COLOR\" : \"${DASHBOARD_HEADER_COLOR:=}\", \
\"DASHBOARD_HEADER_BUTTON_COLOR\" : \"${DASHBOARD_HEADER_BUTTON_COLOR:=}\", \
\"DASHBOARD_HEADER_TITLE_COLOR\" : \"${DASHBOARD_HEADER_TITLE_COLOR:=}\", \
\"DASHBOARD_PAGE_LIST_COLOR\" : \"${DASHBOARD_PAGE_LIST_COLOR:=}\", \
\"DASHBOARD_PAGE_LIST_ACTIVE_COLOR\": \"${DASHBOARD_PAGE_LIST_ACTIVE_COLOR:=}\", \
\"style\": { \
\"--palette-light-neutral-bg-weak\": \"${STYLE_PALETTE_LIGHT_NEUTRAL_BG_WEAK:=}\" \
} \
}" > /usr/share/nginx/html/style.config.json


0 comments on commit 1195ff5

Please sign in to comment.