I have followed the tutorials for https://cloud.google.com/nodejs/ and I can get a node.js app running on Google cloud, but I am using Sails.js for my project and if I try to deploy it with
gcloud preview app deploy app.yaml --set-default
, the deploy fails.
I can't find a tutorial on how to deploy a sails app. What are the steps I should follow?
EDIT: the error I get is ERROR: (gcloud.preview.app.deploy) Not enough VMs ready (0/1 ready, 1 still deploying). Deployed Version: 20150623t154347.385222953610879860
I get this even with the default "empty" sails project created with sails new my_project
.
UPDATE: I was able to deploy by using a different google project where the CPU quota wasn't maxed out, however:
- When I look at https://console.developers.google.com/project/my-project/compute/quotas, I see that an additional CPU is used everytime I run gcloud deploy and the number of CPUs used never decreases. How can I free up these CPUs?
- When I browse to my project, all I see is
Error: Server Error The service you requested is not available yet. Please try again in 30 seconds.
Any idea what can cause this?
UPDATE2: In the App engine console logs I can see:
Fatal error: Unable to find local grunt.
Shouldn't grunt be already part of my project if it was installed with
sudo npm install grunt --save
?
I managed eventually. The problem with Grunt was sorted by installing grunt and grunt-cli locally as well as a bunch of other dependencies.
Here is how to configure a Sails.js project to make it deployable on Google Cloud:
1) Add the following to the beginning of app.js:
2) Create an app.yaml file in the root of the project with the following content:
3) Make sure the package.json file contains the following scripts and dependencies:
4) Create a Dockerfile file in the root of the project with the following content:
5) Change the default port by modifying the config/local.js file as follows:
6) Install all dependencies and push to cloud: