I signed up for the free trial of the google cloud platform, and I'm stuck. My application is a node server using express. It needs to connect to a mongodb cluster. I just need to be able to serve a couple of pages. How could I do this using the compute engine. Is there a really simple tutorial to follow to deploy my app? I can't use the app engine because managed vms aren't available in Europe. Thanks.
相关问题
- MongoDB can not create unique sparse index (duplic
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- Why do Dataflow steps not start?
- Spring Data MongoDB - lazy access to some fields
- google-drive can't get push notifications
相关文章
- node连接远程oracle报错
- mongodb有没有什么办法禁止读取数据的时候进行缓存
- mongodb-aggregate聚合查询分组后如何获得多字段
- mongodb error: how do I make sure that your journa
- How can make folder with Firebase Cloud Functions
- How to track MongoDB requests from a console appli
- @angular-cli install fails with deprecated request
- How do I create a persistent volume claim with Rea
Deploying a node.js app to Google Compute Engine really isn't all that different from deploying it on any other Infrastructure as a Service provider.
Try one of the following tutorials:
You'll need to spin up a Google Compute Engine VM instance, of course, to deploy to.
You can do this using the
gcloud compute instances create
command:Then, connect via
gcloud compute ssh
:You can also do both of these steps from the Cloud Console.
I just want to share one of my deployment experience. I found it's the most easy way in all the tutorials I see.
I use google cloud launcher to launch a Bitnami VM, MEAN Stack in my case. They also have a node.js solution.
Then you can follow this tutorial Bitnami Custom Node.js Application. Basically five steps :
create the basic application directory structure under /opt/bitnami/apps.
apps/myapp
|- conf
|- htdocs
|- data (optional)
put the application code in htdocs folder
start the application
sudo /opt/bitnami/nodejs/bin/node /opt/bitnami/nodejs/bin/forever start myapp.js
or if you use express generated project :
restart the Apache server to refresh new configuration
sudo /opt/bitnami/ctlscript.sh restart apache