Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit 55414a6

Browse files
authored
Merge pull request #296 from nhost/chore/named-volumes-for-node-modules
Named volumes for node_modules
2 parents befaea6 + fd4b813 commit 55414a6

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

nhost/compose/config.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ const (
4848
svcTraefikDefaultImage = "traefik:v2.8"
4949
// --
5050

51+
// volume names
52+
volFunctionsNodeModules = "functions_node_modules"
53+
volRootNodeModules = "root_node_modules"
54+
// --
55+
5156
// environment variables
5257

5358
// envs prefixes
@@ -141,6 +146,12 @@ func (c *Config) build() *types.Config {
141146
c.mailhogService(),
142147
}
143148

149+
// set volumes
150+
config.Volumes = types.Volumes{
151+
volFunctionsNodeModules: types.VolumeConfig{},
152+
volRootNodeModules: types.VolumeConfig{},
153+
}
154+
144155
// loop over services and filter out nils, i.e. services that are not enabled
145156
for _, service := range services {
146157
if service != nil {
@@ -365,6 +376,16 @@ func (c Config) functionsService() *types.ServiceConfig {
365376
Source: "..",
366377
Target: "/opt/project",
367378
},
379+
{
380+
Type: types.VolumeTypeVolume,
381+
Source: volRootNodeModules,
382+
Target: "/opt/project/node_modules",
383+
},
384+
{
385+
Type: types.VolumeTypeVolume,
386+
Source: volFunctionsNodeModules,
387+
Target: "/opt/project/functions/node_modules",
388+
},
368389
},
369390
}
370391
}

nhost/service/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
)
2121

2222
const (
23-
slowStartWaitMsg = "It takes more than usual to start the nhost project. Most likely because CLI needs to pull js dependencies inside a container. Please wait..."
23+
slowStartWaitMsg = "It takes longer than usual to start your Nhost project. Most likely because of the need to install your npm dependencies. Please wait."
2424
)
2525

2626
type Manager interface {

0 commit comments

Comments
 (0)