Skip to content

Commit bdd59fe

Browse files
authored
Split Frontend and Storybook in dev (baserow#4793)
1 parent f632b7b commit bdd59fe

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

docker-compose.dev.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,9 @@ services:
6565
# reducing the chance the containers screw up the bind mounted folders.
6666
UID: $UID
6767
GID: $GID
68-
command: "nuxt-dev-with-storybook"
68+
command: "nuxt-dev"
6969
ports:
7070
- "${HOST_PUBLISH_IP:-127.0.0.1}:3000:3000"
71-
- "${HOST_PUBLISH_IP:-127.0.0.1}:6006:6006"
7271
volumes:
7372
- ./web-frontend:/baserow/web-frontend
7473
- ./premium/web-frontend/:/baserow/premium/web-frontend
@@ -79,12 +78,45 @@ services:
7978
# overwriting existing node_modules.
8079
- node_modules:/baserow/web-frontend/node_modules
8180
- nuxt:/baserow/web-frontend/.nuxt/
82-
- storybook:/baserow/web-frontend/.nuxt-storybook/
8381
- cache:/baserow/web-frontend/.cache/
8482
# Open stdin and tty so when attaching key input works as expected.
8583
stdin_open: true
8684
tty: true
8785

86+
storybook:
87+
image: baserow_web-frontend:dev
88+
profiles: ["optional"]
89+
build:
90+
dockerfile: ./web-frontend/Dockerfile
91+
context: .
92+
target: dev
93+
args:
94+
# We allow configuring the UID/GID here so you can run as the dev's actual user
95+
# reducing the chance the containers screw up the bind mounted folders.
96+
UID: $UID
97+
GID: $GID
98+
command: "storybook-dev"
99+
ports:
100+
- "${HOST_PUBLISH_IP:-127.0.0.1}:6006:6006"
101+
volumes:
102+
- ./web-frontend:/baserow/web-frontend
103+
- ./premium/web-frontend/:/baserow/premium/web-frontend
104+
- ./enterprise/web-frontend/:/baserow/enterprise/web-frontend
105+
- ./tests/:/baserow/tests
106+
- ./deploy/plugins:/baserow/plugins
107+
# dev volumes to avoid polluting your local filesystem with build files or
108+
# overwriting existing node_modules.
109+
- node_modules:/baserow/web-frontend/node_modules
110+
# Open stdin and tty so when attaching key input works as expected.
111+
stdin_open: true
112+
tty: true
113+
healthcheck:
114+
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://localhost:6006/"]
115+
interval: 60s
116+
timeout: 5s
117+
retries: 3
118+
start_period: 30s
119+
88120
celery:
89121
image: baserow_backend:dev
90122
user: "${UID}:${GID}"

web-frontend/docker/docker-entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ case "$1" in
104104
yarn storybook &
105105
attachable_exec_retry yarn dev
106106
;;
107+
storybook-dev)
108+
startup_plugin_setup
109+
setup_additional_modules
110+
# Retry the command over and over to work around heap crash.
111+
attachable_exec_retry yarn storybook
112+
;;
107113
lint)
108114
exec yarn lint
109115
;;

0 commit comments

Comments
 (0)