Cannot find module /parse-server/cloud/main.js

I’m running parse-server inside Docker using this command
docker run -p 1337:1337 --name parse-server -v cloud-code-vol:/parse-server/cloud -v config-vol:/parse-server/config --link mongo-vinted:mongo -d parse-server-vinted --appId xxxxxxxx --masterKey xxxxxxxx --databaseURI mongodb://mongo/test --startLiveQueryServer true --liveQuery "{\"classNames\": [\"_User\",\"Item\"]}" --appName "XXXX" --serverURL "http://localhost:1337/parse" --publicServerURL "http://localhost:1337/parse" --cloud ABSOLUTE_LOCAL_PATH_TO_main.js
However, I’m always getting this error :

unable to find module /parse-server/cloud/main.js

The main.js file is already located inside my local folder parse-server/cloud
What am I doing wrong ?

is ABSOLUTE_LOCAL_PATH_TO_main.js a path in your local machine or in the docker container?

Hi
It’s in my local machine

davimacedo
I got it working by copying main.js inside docker volume by executing this command :
docker cp cloud/main.js parse-server:parse-server/cloud/
I’ll try to figure out a way to copy it in the build time using DockerFile
Thanks for the hint :pray:

1 Like