From c178264c1fc3b92f07dcfef26c5087b40b9dc003 Mon Sep 17 00:00:00 2001 From: hainenber Date: Sat, 14 Sep 2024 14:59:33 +0700 Subject: [PATCH 1/3] fix(install/docker): install zstd for building superset-frontend in containerized env Signed-off-by: hainenber --- docker/docker-frontend.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/docker-frontend.sh b/docker/docker-frontend.sh index bb46c07f988f5..faa4d955baf22 100755 --- a/docker/docker-frontend.sh +++ b/docker/docker-frontend.sh @@ -27,6 +27,10 @@ if [ "$BUILD_SUPERSET_FRONTEND_IN_DOCKER" = "true" ]; then echo "Building Superset frontend in dev mode inside docker container" cd /app/superset-frontend + echo "Installing zstd as prerequisite" + apt update + apt install -y zstd + echo "Running `npm install`" npm install From 21d5c4ceef415cfbd307e6f9f9d7dbc7b74b9d52 Mon Sep 17 00:00:00 2001 From: hainenber Date: Sat, 14 Sep 2024 15:10:13 +0700 Subject: [PATCH 2/3] fix: remove trailing whitespaces per pre-commit hook Signed-off-by: hainenber --- docker/docker-frontend.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/docker-frontend.sh b/docker/docker-frontend.sh index faa4d955baf22..b1bc5a6dbebb1 100755 --- a/docker/docker-frontend.sh +++ b/docker/docker-frontend.sh @@ -27,8 +27,8 @@ if [ "$BUILD_SUPERSET_FRONTEND_IN_DOCKER" = "true" ]; then echo "Building Superset frontend in dev mode inside docker container" cd /app/superset-frontend - echo "Installing zstd as prerequisite" - apt update + echo "Installing zstd as prerequisite" + apt update apt install -y zstd echo "Running `npm install`" From abb396b091bdeb89c72d740ccfda5d57476c4b6f Mon Sep 17 00:00:00 2001 From: hainenber Date: Sun, 15 Sep 2024 11:54:03 +0700 Subject: [PATCH 3/3] fix(install/docker): use zstd-baked image for building superset-node Signed-off-by: hainenber --- docker-compose.yml | 9 ++++++++- docker/docker-frontend.sh | 4 ---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fcb3503a1bc65..605be1333be5a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -149,7 +149,14 @@ services: disable: true superset-node: - image: node:20 + build: + context: . + target: superset-node + args: + # This prevents building the frontend bundle since we'll mount local folder + # and build it on startup while firing docker-frontend.sh in dev mode, where + # it'll mount and watch local files and rebuild as you update them + DEV_MODE: "true" environment: # set this to false if you have perf issues running the npm i; npm run dev in-docker # if you do so, you have to run this manually on the host, which should perform better! diff --git a/docker/docker-frontend.sh b/docker/docker-frontend.sh index b1bc5a6dbebb1..bb46c07f988f5 100755 --- a/docker/docker-frontend.sh +++ b/docker/docker-frontend.sh @@ -27,10 +27,6 @@ if [ "$BUILD_SUPERSET_FRONTEND_IN_DOCKER" = "true" ]; then echo "Building Superset frontend in dev mode inside docker container" cd /app/superset-frontend - echo "Installing zstd as prerequisite" - apt update - apt install -y zstd - echo "Running `npm install`" npm install