How do I migrate a Java webapp to Heroku - java

I have an app that uses Spring and is run with Jetty. I was hosting it on an Amazon EC2 instance but now I want to put it on Heroku. If found the following link but I don't know if it covers everything and since I'm new to Heroku and, to a lesser extent GIT, it seems overwhelming:
http://blog.neo4j.org/2012/01/spring-onto-heroku.html
Does anyone have experience doing this and if so what is the first step? I do have a test Java app running on Heroku.

The Heroku Dev Center should answer most of your questions:
http://devcenter.heroku.com/categories/java
In particular, the Spring MVC example article should help you get started:
http://devcenter.heroku.com/articles/spring-mvc-hibernate

Related

AWS Elastic Beanstalk (single instance) : how to enable HTTPS for a Spring Boot application?

I recently started exploring AWS and have successfully deployed a Spring Boot application on a single Elastic Beanstalk instance.
As a next step, I'd like to have my application use HTTPS. Given that my app is packaged as a jar, I strictly followed this official documentation: Terminating HTTPS on EC2 instances running Java SE.
But my app still works with HTTP only. Did anybody managed to do so ? Any help or link to a working example would be appreciated.
Some technical details about my app: it's a Maven-based Spring Boot project. As explained in the doc, I've created the +.ebextensions+ folder with all the config files at the root of my project. I then used maven-antrun-plugin to include the .ebextensions folder in the jar file.
Thanks in advance for your answers.
Its likely that you are using current version of EB, which is for Amazon Linux 2 (AL2); not stated in the question what is used. The tutorial you've linked uses old version of the EB, which is for Amazon Linux 1 (AL1).
Subsequently, it will not work. Specifically, the nginx settings from the tutorial (.ebextensions/nginx/conf.d/ and .ebextensions/nginx/conf.d/https.conf) will be ignored. The reason is that for AL2, the nginx settings should be provided using .platform/nginx/conf.d and .platform/nginx/nginx.conf.
Also please be aware that there are many differences between AL1 and AL2 in EB, and more changes may be required in the tutorial to make it work on AL2:
Migrating your Elastic Beanstalk Linux application to Amazon Linux 2
Since its not explicitly stated in your question, which version of EB are you using, if this is indeed AL2, you could try running your app using old version of AL1. This at least would enable you to confirm that it actually works. Then you could think of how to port it to AL2.

Can i deploy my Java Spring-Boot Application in my Synology NAS?

I have a Spring-Boot Application with REST API (Maven build and MongoDB Database). I will also make a UI with Angular 2 on top of that (npm build).
What i would like to do is, to host this site, with its backend & database on a server. Can i do that on my Synology NAS (DS216j)? Or should i better buy a small computer like Raspberry Pi 3?
I have heard somewhere that we can deploy our apps in Docker, and Synology has a docker app or sth? Will this help me reaching my goal? I would like to have a step by step guide from your similar setups.
As far as I understand, you only want to get your app running on your NAS, so using Docker would be an option, but no requirement.
According to the model-specific download page, your DS216j supports Java8.
So what you have to do:
Install Java on your NAS
Package your application as standalone jar-file: If not yet done, you can do that in your pom.xml (see Spring Boot documentation for details; btw, this standalone mode is one of the best features of Spring Boot)
Now you can upload the jar-file
Run it via the command line with java -jar <jar-file-name>.jar
Just make sure that the port of your app does not conflict with the ports used by your NAS.
You could also create a Docker image from your app and run it on your NAS, it seems like your model supports Docker: https://www.synology.com/en-us/dsm/packages/Docker. But that would create some extra effort, but no added value, from my point of view.

Simple things about jelastic & jetty

I create maven project with dependencies. Than write simple jetty server which return html page on request. Simple "Hello World" application. Now i want relocate it on jelastic cloud, but can't understand how.
When creating cloud on jelastic you can add jetty server, but i need run my own. Maybe i need connect my servlets or another things. Or maybe i can run server.jar file which assembled by maven.
My google traveling failed. I even not imagine what i must search. Pls help me.
Indeed, you can't up your own servers on the native containers. Moreover, such containers don't provide the root access for a customer.
If you want to run your own server you can use either VPS or Docker solution in Jelastic Cloud.

Import existing project to heroku

I have an existing Spring MVC project. I want to upload this to heroku but I don't know how.
I installed heroku following this tutorial. Can anyone please point me in right direction, for how can I import my existing Spring MVC project to heroku
I am trying to do a similar thing at the moment, but I am deploying my application to CloudBees. This article explains how to deploy a Spring MVC application to a number of PaaS hosting providers (CloudBees, CloudFoundry, Heroku, Windows Azure, OpenShift, Elastic Beanstalk and Google AppEngine). It was of some help to me. Maybe it will be useful to you too. You could also have a look at this article which compares all these services.
If you decide to go with CloudBees, note that they will host your application on Tomcat 6 by default. If you need another server (Tomcat 7, JBoss, GlassFish, etc.) you can switch it easily, but you need to download their SDK
and deploy your application with the bees app:deploy command-line tool which is a part of the SDK.
They have simple and detailed instructions on deployment, DB configuration etc.
UPDATE:
This answer is not relevant any longer, as CloudBees are going to stop providing application hosting services (both free and paid). I received an email from them which says that they discontinue free accounts on 24 September 2014.

How to deploy java application to EC2 like Heroku?

I really like Heroku style to commit the code and everything is deployed to the server. However, I'm building a java webservice which requires read/write file system. So, heroku is not the best option for me. So, I think my best option would be to host it on EC2. However, I want to setup something like when I committed the code and push to Github it also pushes to EC2 server as well.
So, Github would be just a source control, but the server is on EC2. How can I achieve that?
You could use AWS Elastic Beanstalk, which manages server/app container for you.
You can find more information here: http://aws.amazon.com/elasticbeanstalk/
Yes. Java on Play or Spring stack for example can run on Heroku.
Check this article to view all the stacks supported by Heroku.

Categories

Resources