I'm trying to run my project on google cloud. The server is run with quickHttpServe which runs on http://0.0.0.0:8000. I've ssh'ed into my cloud instance, cloned my repo, install stack, built the project, and able to run it on the cloud instance.
It works fine on my local machine and am able to receive html file from the server on http://localhost:8000 but not on http://<my cloud instance external ip>:8000.
I'd like to be able to go to http://<my cloud instance external ip>:8000 and be served a html page as how it works when i run it locally on my machine.
Adding a firewall rule under the VPC network tab in google cloud for ip range 0.0.0.0/0 for tcp:8000 seems to solve the issue.
Related
I've wrote a simple NodeJs (ExpressJs) server that uses Puppeteer to generate PDF files on JSON data being passed to it. While locally everything is working like charm, I'm struggling to run this server on Azure App Services.
I've created a Resource group, within it I've created an App Servces instance (running on Linux) that is connected to my repo at Azure DevOps (via the Deployment Center).
My server has two endpoints:
/ - returns a JSON - { status: "ok" }. I'm using this to validate the running server instance.
/generate-pdf - uses the Puppeteer to generate and return a PDF file.
After successfully starting the App Service instance I'm able to access the "/" route and get a valid response but upon accessing the "/generate-pdf" route the result is "502 - Bad Gateway".
Does my instance require some additional configuration that I haven't done?
Does App Services can not run Puppeteer? Perhaps there is a different service on Azure that I need to use?
Is there a way to automate the process via the Azure DevOps pipeline or release?
Any questions/thoughts/FAQs are more than welcomed. Thanks =)
I'm answering my own question: as was mentioned here https://stackoverflow.com... the Azure App Services does not allow the use of GDI (which is required by Chrome) regardless if you're using Linux or Windows based system. The solution was to put the NodeJs application into a Docker container and manually install Chrome. Once you have a container - just upload it to the Azure App Services and viola!
By default App Servies exposes 80 and 443 ports, so if your application listens on a different port be sure to specify it via the WEBSITES_PORT environment variable.
In my case, I had to upload the Docker image to the Docker hub but you can also set up a pipeline to automate the process.
I've built the Docker image on my M1 Pro and it led to some arch issues when the container was uploaded to Azure. Be sure to add the --platform linux/amd64 in the image-building step if you're building for Linux.
So I'm trying to deploy my NodeJS rest API on Cloud Run and for the most part it deploys successfully except a couple endpoints seem to be failing with either a 404 or 500 error. However when I run the container locally using docker run -p 8080:8080 <image> all the endpoints work. The common thing between all the failing endpoints seem to be that they are accessing the remote database using the credentials stored in the .env file.
EDIT: I think it is because the database is on a private internal ip so I'm trying to figure out what I would need to do for that
As mentioned by #guillaume, if your database is on a private internal network then VPC connector is necessary. You can use the Connecting from Cloud Run to Cloud SQL documentation as guide whether you stick to the private IP only or decided to use a public IP which will not require a VPC connector.
I am a newbee to Google Cloud, however, I setup the project based on Standard App Engine based for my Node.JS application. I downloaded the code from GIT and able to deploy. In my code, it tries to make a Mongo connection to my Replication Server that is hosted at Atlas MongoDB (I guess it's on AWS EC2 instance). I have access control enabled so only server to server with known IPs can connect to my MongoDB.
Obviously I was expecting the connection from my freshly deployed app to fail. So to remediate I want to add the external IP of the instance from Google Cloud (whatever is the Public IP that is seen) to Mongo Network Access. I tried a few IP address I thought are the right ones but it's not working. I see the connection is trying to make to Atlas but it's failing because I am not sure what Public IP address is seen from AppEngine (Docker Instance?)where my app is running.
I tried 0.0.0.0/0 - open to all clients and my app works just fine, however I definitely don't want to open MongoDB access to entire world. If anybody knows more about Google Cloud please help.
Thanks in advance for replying if you have important info to share.
Google App Engine doesn't have an External/Static IP that you can refer. This can be achieved by using a VM on Google Compute Engine that has an External IP with proxy to your App Engine.
Besides that, there is a Feature Request open for this to be checked by Google that you can access here:
Provide static IP for outbound urlfetch requests
Besides that, you can access the documentation Static IP Addresses and App Engine apps, to find out more information on options already available on App Engine.
Please, let me know if the information helped you.
I am facing very weird problem.Please help.
I have developed website using MEAN stack and it is hosted on aws ec2 instance.
If I access that website from my laptop, I can see the data(from mongodb installed on server) in my website.But at the same time when I access the website from some other laptop or say mobile phone(using browser), all the tables are coming blank without any data.
I am not getting, why It is working on my laptop as there is no relation between aws instance and my machine.Except that I use their console/dashboard from my machine.
Thanks.
Please check if you set your laptop host file while developing the website to resolve to the AWS EC2 instance IP where your website is hosted.
Or check the EC2 instance security group if you have opened the HTTP port of the instance just to your IP address.
As above 2 are the only causes that might give the issue mentioned by you.
I created a nodejs virtual machine instance on google cloud (compute engine). I also created 3 mongodb instances on the compute engine. Now I pushed my local application to the google cloud repository. How do I link the app.js file to this server so it starts running the script and serving the files. I already changed the A record of my domain that I registered with godaddy so it's external ip is the same as that of the nodejs server I am running but all I am getting is this page.
Bitnami developer here.
You need to copy your files to the remote repository, create the configuration files and after that you have to include that configuration in the configuration of Apache to serve the application. It looks like you have done most of the work, but there may be an error in one of the steps. This guide will help you to configure your application in order to access it properly.
https://wiki.bitnami.com/Applications/Bitnami_Custom_Node.js_Application
I hope it helps.
Jota