Skip to content

Commit 8ef0e20

Browse files
committed
fix(compose): preserve image node_modules from host bind mount
The webhook and dev composes mount ../:/app, which shadowed the node_modules built by `RUN npm install` in Dockerfile.dev with whatever (usually empty) node_modules sat in the host repo. The webhook entrypoint then ran `rosemary webpack:compile`, npx webpack tried to self-install webpack-cli and aborted, taking the container down. Add an anonymous volume on /app/node_modules in every service that bind-mounts the repo (web/worker on prod.webhook.yml; worker on dev.yml — web on dev.yml already had it). The image's node_modules is now authoritative, and the host no longer needs Node installed.
1 parent b4eded8 commit 8ef0e20

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

docker/docker-compose.dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ services:
3232
- ../.env
3333
volumes:
3434
- ../:/app
35+
- /app/node_modules
3536
- /var/run/docker.sock:/var/run/docker.sock
3637
command: [ "bash", "-c", "bash /app/docker/entrypoints/worker_entrypoint.sh" ]
3738
networks:

docker/docker-compose.prod.webhook.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ services:
1313
- ../.env
1414
volumes:
1515
- ../:/app
16+
- /app/node_modules
1617
- /var/run/docker.sock:/var/run/docker.sock
1718
command: [ "bash", "-c", "bash /app/docker/entrypoints/webhook_entrypoint.sh" ]
1819
restart: always
@@ -31,6 +32,7 @@ services:
3132
- ../.env
3233
volumes:
3334
- ../:/app
35+
- /app/node_modules
3436
- /var/run/docker.sock:/var/run/docker.sock
3537
command: [ "bash", "-c", "bash /app/docker/entrypoints/worker_entrypoint.sh" ]
3638
restart: always

0 commit comments

Comments
 (0)