12

First docker version of the Java Spring Boot and Angular 2 ‘Hello World’ tutoria...

 3 years ago
source link: https://marco.dev/2016/09/20/first-docker-version-of-the-spring-boot-angular-2-sample-application/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

java-version.com: What's new in Java 16? 15? Keep up to date!

First docker version of the Java Spring Boot and Angular 2 ‘Hello World’ tutorial

I updated the basic example that you can find here: https://marco.dev/2016/02/23/spring-boot-angularjs-2-typescript-hello-world-tutorial/

Now it is compatible with docker. You can download the first version of the dockerfile here:

https://github.com/marco76/SpringAngular2TypeScript/blob/master/Dockerfile

It’s only a first test and a lot of work is still needed but you can build it:

docker build -t my-java-app .

The source code and the dependencies are downloaded. When the build end you can launch the application:

docker run –rm -it -p 8080:8080  my-java-app java -jar /usr/src/myapp/angular2.jar

davis_1

You can see the result on localhost:8080

davis_2

Many people asked how to compile the project in eclipse … well, no need of eclipse or other IDE.

The procedure of creation of a unique war/jar is a bit complicated at the moment but only maven and npm are used. Typescript and npm compile the Angular files. Maven compile the java classes and build the jar/war including the backend (java) and frontend (javascript).

Personally I think that the frontend and backend should be developed in 2 separated projects.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK