-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Docker, how to npm install for cloud code.... #4590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
One option, which I've been using for parse-server-compose, is to install dependencies into the same directory as the cloud code and mount that in docker:
If any dependencies use native code and need to be built in the container you'll need to run this first:
|
@stephentuso so I worked out a super hacky workaround that is close to yours: run make sure to add parse-server as a dependency. I'm using aws beanstalk (for now, hopefully switching to kubernetes as soon as I get the time). I overwrite the entry point in my Dockerrun.aws.json to: I'll study what you've got there and see if its an improvement for me. my hack really sucks because I have to cd into cloud, run install, cd out and then deploy. i'm wondering if I can somehow adjust an npm-run-script, preinstall or postinstall to check if there is a a ./cloud/package.json and install that.... the ./cloud is hardcoded in the dockerfile I'm also looking at @yongjhih to see how he does it in https://github.com/yongjhih/docker-parse-server |
Gotcha yeah that looks about the same, I was only thinking about running locally. Could potentially be easier to just write a new Dockerfile |
And I spoke too soon. My packages are getting installed. And my cloud code is being processed by parse (if I put a debug log in my cloud code files it ends up in the logs), but when I call my cloud functions parse doesn't fine them with ```error: Invalid function: "sendCode" code=141, message=Invalid function: "sendCode"`` enough debugging on this for today :( |
I'm going to close this as unresolved for now. |
Just write a regular express app, install parse-server as a dependency and mount it to the express app |
We are running into this issue as well with Docker.. Whats the proper procedure for getting cloud code to work in a container? I see some solutions but has this never been tested till now? |
I've been trying to use the parse-server docker. I've run into a problem trying to use cloud code and I'm curious if anyone has a solution.
If my cloud code requires npm packages (would think this is almost always the case), is there a pattern or solution of how to npm install?
The text was updated successfully, but these errors were encountered: