Skip to content

Commit 1195ff5

Browse files
authored
Added option to define style config using environment variables for the NeoDash docker image (#876)
1 parent 43c9463 commit 1195ff5

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

docs/modules/ROOT/pages/developer-guide/style-configuration.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ link:https://cdn.jsdelivr.net/npm/@neo4j-ndl/[email protected]/lib/tokens/css/tokens.cs
66

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

12+
....
13+
docker run -p 5005:5005 \
14+
-e DASHBOARD_HEADER_BRAND_LOGO=https://picsum.photos/500/100 \
15+
neo4jlabs/neodash
16+
....
17+
1218
An example configuration for NeoDash
1319

1420
....

scripts/config-entrypoint.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,17 @@ echo " \
2727
\"customHeader\": \"${customHeader:=}\" \
2828
}" > /usr/share/nginx/html/config.json
2929

30-
echo "${styleConfigJson:={\}}" > /usr/share/nginx/html/style.config.json
30+
echo " \
31+
{ \
32+
\"DASHBOARD_HEADER_BRAND_LOGO\": \"${DASHBOARD_HEADER_BRAND_LOGO:=}\", \
33+
\"DASHBOARD_HEADER_COLOR\" : \"${DASHBOARD_HEADER_COLOR:=}\", \
34+
\"DASHBOARD_HEADER_BUTTON_COLOR\" : \"${DASHBOARD_HEADER_BUTTON_COLOR:=}\", \
35+
\"DASHBOARD_HEADER_TITLE_COLOR\" : \"${DASHBOARD_HEADER_TITLE_COLOR:=}\", \
36+
\"DASHBOARD_PAGE_LIST_COLOR\" : \"${DASHBOARD_PAGE_LIST_COLOR:=}\", \
37+
\"DASHBOARD_PAGE_LIST_ACTIVE_COLOR\": \"${DASHBOARD_PAGE_LIST_ACTIVE_COLOR:=}\", \
38+
\"style\": { \
39+
\"--palette-light-neutral-bg-weak\": \"${STYLE_PALETTE_LIGHT_NEUTRAL_BG_WEAK:=}\" \
40+
} \
41+
}" > /usr/share/nginx/html/style.config.json
42+
43+

0 commit comments

Comments
 (0)