Skip to content

Possibility: Use global npm cache #2

Closed
@rfay

Description

@rfay

I see this in the post-start:

    - exec: bash -ci 'worker=/mnt/ddev_config/diffy-worker-main; ( [ ! -d $worker/node_modules ] && npm install --prefix $worker && chown -R $DDEV_UID:$DDEV_GID $worker/node_modules ) || rm -rf $worker/node_modules'

You're doing an npm install without caching.. but you have ddev-global-cache mounted. And there's a whole npm_config_cache already built and waiting that could be used there (and cached). So you could add the environment variable

    - npm_config_cache=/mnt/ddev-global-cache/npm

And I don't think you'd have to chown or anything. (BTW, I think your chown is from an earlier version of this when you were running the container as root, so that should be removable now.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions