Skip to content

empty node_modules folder gets created as root by bind mount if it doesn't already exist #115

Description

@CorruptBandit

To be able to do dev both inside and out of Docker the node modules folders need to be completely separate to avoid clashing.

The code that creates the directory:

   volumes:
      - .:/opt/node_app/app

This only happens when the directory doesn't exist yet, and with the other code in the compose it will prevent the folder from being populated by content from the Docker container (which is good)

The problem is that the empty gets created as root, meaning npm installs outside of docker fail.

The simplest workarounds are to either create the directory before ever running docker compose up or don't use . for the volume and instead explicitly specify the dir that the source code for the app is in.

Is there a nicer way to handle this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions