From 7a72e9866ad3253f4b217b3fc11ce3782c34e9ad Mon Sep 17 00:00:00 2001 From: Jim O'Donnell Date: Mon, 18 Nov 2024 18:04:50 +0000 Subject: [PATCH] Separate node_modules volumes for production and development --- docker-compose.yml | 7 +++++-- packages/app-project/docker-compose.yml | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index dab34d5175..a144cfe44b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,8 @@ services: prod-shell: image: front-end-monorepo_prod:latest + volumes: + - node_modules-prod:/usr/src/node_modules build: context: ./ args: @@ -13,7 +15,7 @@ services: dev-shell: image: front-end-monorepo_dev:latest volumes: - - node_modules:/usr/src/node_modules + - node_modules-dev:/usr/src/node_modules build: context: ./ target: builder @@ -58,4 +60,5 @@ services: ports: - "3003:3000" volumes: - node_modules: + node_modules-dev: + node_modules-prod: diff --git a/packages/app-project/docker-compose.yml b/packages/app-project/docker-compose.yml index 717d96af0f..db811879e4 100644 --- a/packages/app-project/docker-compose.yml +++ b/packages/app-project/docker-compose.yml @@ -21,7 +21,7 @@ services: - ./pages:/usr/src/packages/app-project/pages - ./src:/usr/src/packages/app-project/src - ./stores:/usr/src/packages/app-project/stores - - node_modules:/usr/src/node_modules + - node_modules-dev:/usr/src/node_modules storybook: image: front-end-monorepo_dev:latest entrypoint: @@ -35,6 +35,6 @@ services: - ./pages:/usr/src/packages/app-project/pages - ./src:/usr/src/packages/app-project/src - ./stores:/usr/src/packages/app-project/stores - - node_modules:/usr/src/node_modules + - node_modules-dev:/usr/src/node_modules volumes: - node_modules: + node_modules-dev: