Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amdelamar/vertx-cloudfoundry
A simple Java webapp using Eclipse Vert.x on Cloud Foundry
https://github.com/amdelamar/vertx-cloudfoundry
cloudfoundry java vertx
Last synced: about 2 months ago
JSON representation
A simple Java webapp using Eclipse Vert.x on Cloud Foundry
- Host: GitHub
- URL: https://github.com/amdelamar/vertx-cloudfoundry
- Owner: amdelamar
- Created: 2017-12-13T18:43:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-20T20:27:22.000Z (about 7 years ago)
- Last Synced: 2024-08-04T01:09:14.663Z (5 months ago)
- Topics: cloudfoundry, java, vertx
- Language: Java
- Size: 80.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
- vertx-awesome - Cloud Foundry - An example Vert.x for deploying to a [Cloud Foundry](https://www.cloudfoundry.org/) service provider. (Examples)
README
= Vert.x on Cloud Foundry
This demo shows a very simple hello world Vert.x project for link:https://www.cloudfoundry.org/[Cloud Foundry]. It has a simple HTTP server which simply serves the `/webroot/index.html`.
This demo uses link:http://vertx.io/[Vert.x] and is packed using the official link:https://github.com/cloudfoundry/java-buildpack[CloudFoundry java-buildpack]. The `manifest.yml` specifies the app's memory to be 768MB because any lower and the java-buildpack throws an error that it can't allocate enough heap space. (See the link:https://www.cloudfoundry.org/certified-platforms/[list of certified platforms]).
The environment variable `PORT` is normally provided by your CloudFoundry service, and therefore can change when being deployed. Otherwise the default port is `8080`.
The `webroot` is located under `src/main/java/resources` so it can be packaged into the JAR file. If the `webroot` is not packaged inside the JAR file like this, then we can't deploy it easily to CloudFoundry using the java-buildpack. A custom buildpack would have to be created instead. But that's beyond the scope of this demo.
This demo also uses Gradle+shadowJar plugin to build the application and all it’s dependencies into a single "fat" jar.
== Prerequisites
* link:https://www.java.com/download/[Java 1.8]
* link:https://docs.cloudfoundry.org/cf-cli/install-go-cli.html[CloudFoundry CLI]
* A Cloud service provider, such as link:https://www.ibm.com/cloud/[IBM Cloud], link:https://pivotal.io/platform[Pivotal], or link:https://cloudplatform.sap.com[SAP].== Build fat jar
1. Run build `./gradlew clean build`
1. Test app `java -jar build/libs/vertx-cloudfoundry-0.1.0-all.jar`
1. Visit link:http://localhost:8080/[http://localhost:8080/] to see the app running.== Deploy to Cloud Foundry
1. Deploy `cf push -f manifest.yml myapp`
1. Run `cf apps` to see the app running. Visit the url provided.