Home United States USA — software Running Docker Containers on Cloud Foundry

Running Docker Containers on Cloud Foundry

306
0
SHARE

This article describes how to run Docker containers in Cloud Foundry without having to worry about setting up a Kubernetes cluster.
Let’s be friends:
Comment (0)
Join the DZone community and get the full member experience.
If you are an experienced developer already familiar with Docker, here’s a quick way to just deploy your containers into the cloud without having to worry about setting up and managing a Kubernetes cluster. And also important…it comes for free using Cloud Foundry.
Let’s start by creating a simple NodeJS application locally using ‘npm init’, give your app a name e.g. ‘tinyapp’ and use ‘server.js’ as the entry point.
This will generate a ‘package.json’ file:
Next install the NodeJS ‘Express-framework’ using the command:
Create a NodeJS application file ‘server.js’
Test the NodeJS application locally using the command:
This will launch the app locally to listen on port 3000. You can verify the working of the app with a browser http://localhost:3000.
Now we can already deploy this app onto Cloud Foundry with the standard NodeJS runtime buildpack using the command:
Once the deployment is done we can test the app using the given URL with Curl or with a Web Browser.

Continue reading...