How to deploy a Sails.js project on Google cloud?

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 ?

-------------Problems Reply------------

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:

"use strict";
var express = require('express');
var app = express();
app.use(require('./lib/appengine-handlers'));

2) Create an app.yaml file in the root of the project with the following content:

# [START runtime]
runtime: custom
vm: true
api_version: 1
module: default
# [END runtime]

# [START resources]
resources:
cpu: .5
memory_gb: 1.3
disk_size_gb: 10
# [END resources]

# [START scaling]
automatic_scaling:
min_num_instances: 1
max_num_instances: 5
cool_down_period_sec: 60
cpu_utilization:
target_utilization: 0.5
# [END scaling]

env_variables:
NODE_ENV: production

3) Make sure the package.json file contains the following scripts and dependencies:

"scripts": {
"start": "node app.js",
"monitor": "nodemon app.js",
"deploy": "gcloud preview app deploy app.yaml"
},
"dependencies": {
"express": "^4.12.0",
"gcloud": "^0.15.0",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-coffee": "^0.13.0",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-cssmin": "^0.12.3",
"grunt-contrib-jst": "^0.6.0",
"grunt-contrib-less": "^1.0.1",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-gcloud": "^0.2.0",
"grunt-sails-linker": "^0.10.1",
"grunt-sync": "^0.2.3",
"sails": "^0.11.0",
"sails-disk": "^0.10.8"
}

4) Create a Dockerfile file in the root of the project with the following content:

# [START docker]
FROM google/nodejs-runtime
# [END docker]

5) Change the default port by modifying the config/local.js file as follows:

port: process.env.PORT || 8080

6) Install all dependencies and push to cloud:

sudo npm install --save
gcloud preview app deploy app.yaml --set-default

Category:node.js Views:1 Time:2019-02-10

Related post

  • How to deploy my asp.net project in IIS? 2009-06-11

    I have windows 2003 server , and a asp.net project developed in VS2008 developer edition how to deploy this website in the server? --------------Solutions------------- Would it not be easier to just use the Publish Website option in Visual Studio? It

  • How to Deploy my Open Source Projects using Maven's Central Repository? 2009-11-02

    Is there anything I could do to get my own open source stuff into Maven's Central repository? I've wondered many times how I could get my own projects into Maven's Central repository. I was asking this myself, especially as I've seen some well known

  • How to deploy a specific child project with cargo:start using maven 2010-07-05

    I have a developed application and I am just trying to make the build process easy. The POM file for parent looks like this: <parent> <groupId>com.shc.obu.ca</groupId> <artifactId>shcobuca-pom</artifactId> <version

  • How to deploy VS 2003 asp project 2011-02-17

    Please share how to deploy/release VS 2003 asp project and which files need to be put under wwwroot. --------------Solutions------------- Perhaps this link can be useful, it has a whole range of articles/videos on this topic: http://www.asp.net/mvc/d

  • How to deploy WAR of Maven Project to JBoss server from Eclipse? 2011-04-30

    I want to deploy WAR of Maven project to JBoss server. I know that from Eclipse Export->War deploy the WAR file to JBoss. But How can I do this for Maven Project. Any step by step information or useful website link will be very helpful to me. Than

  • Unable to Deploy Android App Engine Project on Google App Engine 2012-01-16

    I am create one smile application in Android + Google App Engine in eclipse. i am trying to deploy that app on Google app Engine but it show the error message Log Cat : Unable to update: com.google.appengine.tools.admin.HttpIoException: Error posting

  • How to Deploy a C#.net project in Visual studio 2010 (ultimate)? 2010-10-28

    solution is developed for x86 platform and framework 3.5... i need to include pre-request setups in my offline project ...dot net frame work 3.5 , sql server compact server sp 2,windows installer 3.1 are the pre-request that the setup should check fo

  • How to deploy an ASP.NET project so that there is no code in the .aspx files? 2011-03-15

    I've recently become the maintainer of an ASP.NET web project. In the course of deploying some changes, we noticed that at some point the way the project deploys has changed. The project is a web application project. Currently, when I "Publish" it to

  • VS2008 How to deploy a WebSite Application Project 2011-07-22

    So I have created a Web Site Application project in VS2008 and is fine on my local machine. Just wondering how to I deploy this to a dev server i.e via FTP i.e. do I need just copy over all files i.e. Microsoft Visual Studio Solution Visual Basic Pro

  • How to deploy a copied WP7 project without removing the original one 2011-04-29

    Here is my problem. I made a WP7 application. I copied the project folder of this application in order to make a similar application without having to re-write the same code. On the copied project, I changed the assembly information etc.., and I also

  • How to deploy a pinax django project to iis via Helicon Zoo? 2011-12-03

    Today I found a simple way to deploy django projects to iis using Helicon Zoo tool, see http://www.helicontech.com/zoo/ http://www.helicontech.com/articles/running-django-on-windows-with-performance-tests/ I tested some projects of django, such as os

  • How to deploy a Zend new project 2011-10-20

    I am currently trying to update a previous web site using Zend Framework. As I dont want to work in a local network, I subscrided to a pro offer of OVH server. So I put my old website in the www folder, I uploaded the Zend Framework directory (ZendFr

  • How can I run the example project of Google App Engine + GWT in Eclipse? 2009-07-27

    Ive installed the Google Plugin for Eclipse and created a demo project using App Engine and GWT. Now I want to launch and see it. But after compile nothing else happens. Shouldn't there be an integrated browser that shows the app? --------------Solut

  • How to deploy Java App Engine application on another cloud? 2011-06-06

    I have written a relatively simple Java App Engine application which I would like to be able to port to another cloud provider. I am using the JDO datastore API so I think my data handling should be portable to other backends as listed here: http://w

  • How Do I install Wowza Streaming Engine on Google Cloud? 2014-10-26

    I'm trying to install Wowza streaming engine manager on google cloud, but it is not working. I am using this tutorial. I create my wowza streaming engine image, firewall rules, and instance with no problem. However, when I test my instance through th

  • How to compile a Web Site Project directly out of Visual Studio without aspnet_compiler? 2011-12-05

    I have a Web Site project and want my .aspx and .cs to be compiled. For this I am using a the aspnet compiler like this: aspnet_compiler -v /My_Site -p c:\site_published_with_Visual_Studio c:\site_compiled_with_aspnet_compiler This means, that I have

  • How to deploy a war file in JBoss AS 7? 2011-08-10

    I downloaded JBoss Application Server 5 and successfully deployed a war file. I copypasted the Hello.war which has a simple index.jsp file into \jboss-5.1.0.GA-jdk6\jboss-5.1.0.GA\server\default\deploy and it worked fine. However when I used JBoss AS

  • Deploying an App to Google cloud 2011-08-11

    Possible Duplicate: Google App Engine, getting started How do I deploy a Java application to a Google cloud? What are the steps involved ? I am a beginner at programming so it would be great if you could help me out! --------------Solutions----------

  • How To: Deploy SQL Database Project using Team System Build 2010 (beta 2) 2009-10-27

    Can anyone shed some light on how to get Team Build 2010 beta 2 to push a SQL database project to the SQL server? In VSTS 2008 you'd just add MSBuild commands with the targets attribute set to "deploy" in the TFSBuild.proj file, but I'm having a litt

  • How to configure properly IntelliJ IDEA for deployment of JBoss Seam project? 2010-04-08

    I would like to use IntelliJ IDEA for development of JBoss Seam project. seam-gen is creating the project stub, however the stub is not complete. In particular it is not clear how to deploy such project. First of all I had to define manually web proj

  • How do I deploy my Maven WAR project to a Cargo-Tomcat container? 2011-10-24

    I'm using Maven 3.0.3 with the Maven-Cargo plugin 1.1.3 with Tomcat 6.0.33. How do I deploy my existing WAR project to an installed Tomcat container using Maven-Cargo? I have this configuration ... <plugin> <groupId>org.codehaus.cargo<

  • How to deploy Rails project in Nginx server using passenger? 2012-01-23

    In my local, I am using werbrick application server for my localhost. I have Ruby version 1.9.2 .and Rails version 3.1. How to deploy On live,with Rails Project On Nginx Server? And What will be the application server (like passenger module with apac

  • How to deploy Rails 3 project using "Rake"? 2012-01-24

    How to deploy Rails project on live server using Rake task? For other projects I used Capistrano deployment.But for this project I wish to use rake...if anybody guide me please ... What gem I will need to install or what is the procedure I should fol

  • how to deploy / deployment django projects / application with aptana to webserver apache wsgi 2012-03-28

    I would like to deplay a django application/project, which i have created within Aptana. It is a simple hello world. I can run the application locally and everything works fine, but how to deploy it to a webserver. The deploy button is grey and not w

  • How to Deploy SQL Server Analysis Services Project to a different domain? 2009-07-31

    What is the best way to deploy an analysis services project database to a different domain. I have network access to that domain (I am able to ping it). When I try to deploy the SSAS project to a live server in a different domain I get the following

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.164 (s). 11 q(s)