I am trying to deploy an existing ember-nodejs application into bluemix environment. I tried the following steps.
bluemix api https://api.ng.bluemix.net
bluemix login -u username -o org_name -s space_name
cf push app_name
I also tried the above command with an ember build pack from the list of
compatible CF build packs
cf push app_name -b https://github.com/cloudfoundry-community/cf-docs-contrib/wiki/Buildpacks
Uploading is successful, but the application doesnt start up. Is there a recommended way of deploying ember-node js application?
Update
It was a memory issue. I removed the other running apps and tried the cf push command again. The node modules got installed and the application also started without any fuss.
According to the user, this was actually a memory issue. Once he stopped the other running apps, his node modules were installed and the application started without any further errors. There are no issues specific to deploying ember-nodejs applications in the Bluemix environment.
Related
I am running a web service on a reasonably standard MERN stack on a Ubuntu server. I am not overly familiar with web deployment or web programming but I have found myself with this project.
The web service has a pretty extensive list of instructions on how to deploy the service, but it has no instructions on how to undeploy / redeploy it. In addition, it was the sellers of the service's code that deployed it on our server.
I have made some minor changes to the code (fixing spelling, removing / adding functionality) and I cannot seem to work out how to safely undeploy or redeploy the service.
The list of instructions for deployment is, essentially:
yarn
yarn build
yarn start:prod
pm2 start dist/main.js
Doing this as-is while the old service is running obviously doesn't work as the port that I am trying to relaunch on is being watched. Stopping the pm2 process allowed me to redeploy using the above method but has now caused a 502 Gateway error when I relaunch the process.
What is the safe method to undeploy and / or redeploy a service using this tech stack?
You first may want to have a look around on your ubuntu server.
PM2 is like a service manager. To get a list of running services, run this command.
pm2 ls
A typical output:
Typically when you install an update, you just need to restart them.
pm2 restart <service-name>
e.g. pm2 restart cache in my example
I'm trying to deploy an Angular CLI app to Azure App Service on Linux OS, using Azure Dev Ops - but no success. I get Image 1. No error in the server or application logs.
This is what I done so far:
Built the Angular CLI app using DevOps Build and placed the resulted "dist" folder to the "drop" folder. See below (Image 2) the tasks that compose my build. This is working fine and creating the expected files.
Created a release in DevOps, deploying all the dist files in the wwwroot folder in the Azure App Service in Linux. Shown below are both, the wwwroot folder (left) and my local dist folder (right) after I run a ng build --prod.
I have the suspicion that I need to kickstart the angular by feeding some time of command when doing the deployment. I have tried running "ng serve --host 0.0.0.0" but that didn't work.
Check the Azure App Service > Linux section on this page. Essentially, you have to serve the app. You can configure this with a ecoysystem.config.js PM2 file in the root directory, with this inside.
module.exports = {
apps: [
{
script: "npx serve -s"
}
]
};
I also added npx serve -s in the App Service Configuration > General Settings > Startup Command
See also: https://burkeholland.github.io/posts/static-site-azure
I had to give the npx serve -s as the startup command
Then set the Runtime Stack with node framework 10.16 (NODE|10.16). See below
Then everything started working.
If you still want to use App Service - Web App you can just the Windows OS instead of Linux.
Here are the parameters I Used:
Since the output of building angular is a static web app, IIS will serve the site right away.
When using Linux App Service container, you may also select PHP stack containing Apache2 Server. Since, Angular files are static ones (JS, CSS, HTML), so you just need some web server to serve this content.
Example configuration:
If you look at the default 'Deploy Node.js App to Azure App Service' release template, it uses the 'Deploy Azure App Service' task and adds the following commands to the task. this might help you out.
There is a subtle and big difference between the Linux and Windows App service: IIS - which in Windows is actively looking to serve any app, whereas in Linux you have to spin up something on your own to serve it - Express for example.
After some research I discovered that I don't need a full App service dedicated to run a static app (such as Angular or React). It can be done just as efficiently and much cheaper with something like Storage. -> https://code.visualstudio.com/tutorials/static-website/getting-started
I had the same problem on Azure App Service with Linux and Node, solved it using below startup command
pm2 serve /home/site/wwwroot --no-daemon --spa
I have a mobile (Ionic 2) chat application with the following implementation, that uses nodejs-0.10 and MongoDB 3.2.7 and Meteor 1.4.1.1. It works perfectly on my localhost.
Now I need to deploy it to an OpenShift server. I have followed the following steps and created a server on OpenShift with Meteor. It is connecting with Git, and I can push my code to the server.
I am pretty sure the Meteor server is running on OpenShift, because I saw something to that effect on the startup logs (via ssh). However, I am not sure how to connect to the Meteor server to test it.
The domain is nodejs-easyjobs.rhcloud.com (54.208.77.250) on the OpenShift server, I can ping this successfully.
I am using Ionic 2 to build the mobile app. I am currently just running on Android, but plan to add iOS and Windows.
I am following this tutorial, and it runs on localhost. However, I am not sure where this is configured. I guess localhost is default, and you need to change it to a different host if needs be.
If I check my OpenShift server (nodejs-easyjobs.rhcloud.com) via ssh, I can see that the contents of the Meteor bundle directory is on the server. So Git is pushing the code.
The part I don't understand is:
Do I need to configure Meteor differently for being on the OpenShift
Server? Or do I just leave it as is?
Where do I configure the client
(Ionic 2) to point to the OpenShift server?
Question:
My question is, how do I configure my mobile app (Ionic 2) to connect to the OpenShift Meteor Server?
UPDATE:
My dir structure:
openshift-appname
.../ionic-apps/nodejs/bundle/server/...
meteorapp
.../ionic-aps/myIonicApp/api/.meteor/...
.../ionic-aps/myIonicApp/api/server/...
The contents of the .../ionic-apps/nodejs is cloned on the OpenShift server with Git.
I followed this tutorial to deploy the Meteor bundle to OpenShift. `
So I used the following to build my Meteor app:
> cd .../ionic-aps/myIonicApp/
> meteor build .../ionic-apps/nodejs --directory --server-only
As far as I can see, I may be wrong, but the Meteor Server is all correct and running on OpenShift. I need to know how I can get my Ionic2 app to access it.
Step1: Find the access point to the Meteor server using the OpenShift
IP. i.e. nodejs-easyjobs.rhcloud.com (54.208.77.250).
Step2: Configure my Ionic2 client to use this.
IBM Devops provides the option of live-edit mode for applications hosted on Bluemix. Once enabled my node.js application failed with 503 errors, but the status of the application seemed fine.
On checking further, found that this was a known issue when Live Edit feature is used against an application running using the Node 4.x runtime on IBM Bluemix.
One way to get around this is by using 'cf' command line tool to push the application with Live Edit disabled initially and then manually enable Live Edit by using the 'cf set-env' command.
At First push the app, ensuring that the "BLUEMIX_APP_MGMT_ENABLE" variable is not set:
$ cf unset-env appName BLUEMIX_APP_MGMT_ENABLE
$ cf push appName
Then enable Live Edit mode manually using the environment variable, and restart the app:
$ cf set-env appName BLUEMIX_APP_MGMT_ENABLE=devconsole+inspector+shell
$ cf restart appName
This should help getting the live edit working for Node.js applications.
I built a Meteor app, and it runs on my local machine, where I have meteor installed.
I have never deployed an app online, and am trying to put the app on heroku.
I first tried to use buildpack/jordansissel/heroku-buildpack-meteor.git, but I got an error "Meteor requires Node v0.10.41 or later"
I then tried to use buildpack/michaltakac/meteor-buildpack-horse.git but it failed to push because it couldn't unpack Node.
Lastly I've tried kevinseguin/heroku-buildpack-meteor.git but I get lots of warnings about npm depricated http://prntscr.com/bewzak
When I look at the logs it says "Slug compilation failed: failed to compile Node.js app"
I also get Error: MONGO_URL must be set in environment
I don't know enough to understand what the errors are, or how to get my app deployed
Image of errors: http://prntscr.com/bex0av
my goal it to get the site on gr-fireworks.herokuapp.com
I contacted Heroku helpdesk and they said they couldn't help me because the issue was outside the scope of Heroku Support.
I tried to reach out to Snap CI who said they were successful in deploying it, but when I try to type in exactly what they did, I am still getting the error about Node https://snap-ci.com/ankitsri11/Fireworks/branch/master/logs/defaultPipeline/1/Heroku?back_to=build_history
My repository I'm trying to deloy is on git at github.com/jschwarzwalder/Fireworks
From description of your problem I can conclude you need to do 2 things on your app's Heroku dashboard (Settings tab):
Add MONGO_URL environment variable that points to your Mongo DB database. You can create mongo instance on external service or use mLab Heroku addon (it has free plan).
So your environment variables may look like:
Also, you may need to add METER_SETTINGS if you use --settings settings.json and ROOT_URL - URL of you app gr-fireworks.herokuapp.com (is required).
Set this buildpack:
Ensure you have .git at the end of url.
Now you can deploy your app using single command (if you setup Heroku Toolbelt and heroku remote points Heroku's app repository):
$ git push heroku master