Skip to content

RESTful JOptTourOptimizer in Docker

Containerizing an application helps to use it more conveniently across different platforms and, most importantly, as a microservice. Further, scaling an application becomes more straightforward as different standardized orchestration tools can be utilized. It can be launched either (locally) as part of a docker-compose or as a highly-scalable web-micro-service in a Kubernetes cluster, to give an example.


Overview


Tech Stack - How JOptTourOptimizer is containerized

RESTful JOptTourOptimizer can be used as a Docker container utilizing Spring WebFlux and Swagger. Internally the Java version of TourOptimizer is utilized.

Screenshot


How to start JOptTourOptimizer-Docker

JOptTourOptimizer can be pulled from Docker Hub - JOpt TourOptimizer . In a first step, you can pull the image and start a container in your local docker environment (refer, for example, to, Docker Desktop for help.

If you need any help setting up your Docker-environment please have a look at the guide here.

Setup JOptTourOptimizer-Docker

Setting up JOptTourOptimizer in your Docker environment only takes these three steps:

1) Pulling the image:

docker pull dnaevolutions/jopt_touroptimizer

2) Running a container:

docker run -d --rm \
    --name myJOptTourOptimizer \
    -e SPRING_PROFILES_ACTIVE="cors" \
    -p 8081:8081  \
    dnaevolutions/jopt_touroptimizer

Same command as a single line:

docker run -d --rm  --name myJOptTourOptimizer -e SPRING_PROFILES_ACTIVE="cors" -p 8081:8081  dnaevolutions/jopt_touroptimizer

Activating the profile "cors" will allow doing REST-calls from the same localhost from another application.

(If desired, please adjust docker run argument to your needs)

3) Open: http://localhost:8081

...and you should see the Swagger-Interface:

Preview:

Screenshot


How to make use of JOptTourOptimizer-Docker

By default, you are allowed to run an Optimization with up to 15 elements without providing a license key. In case you already have a license key for JOptTourOptimizer (Java-Maven) you can use that one.

After you opened http://localhost:8081 you see the Swagger interface of JOptTourOptimizer. You can generate a client in your desired language by using the SwaggerEditor.

Simply copy the Swagger definition under http://localhost:8081/v3/api-docs into the SwaggerEditor and accept to convert JSON to YAML.

You can also use tools like OpenAPI Generator to create models in your desired language.

Info

We enabled almost all features of our core library. Contact us in case you need help!

Please visit our Docker-REST-TourOptimizer GitHub Repository to read the latest instructions.


DNA Demo Application

To utilize JOptTourOptimizer-Docker, we created an angular-demo application. This demo application is hosted on Microsoft Azure and is made available via https://demo.dna-evolutions.com.

Info

You can access the latest source-code at https://github.com/DNA-Evolutions/Angular-Demo-Application-Source.

The angular-demo application was generated with Angular CLI version 10.1.2. Further, we utilized OpenApi Generator to automatically create the required TypeScript models from the OpenApi definition provided from our Swagger definition of JOptTourOptimizer.

DNA Demo Application from Docker

For getting the latest instruction on how to start the DNA Demo Application as Docker-container, please visit our JOpt DemoApplication DockerHub Repository to.

DNA Demo Application build from source

For getting the latest instruction on how to start the DNA Demo Application from source, please visit our JOpt DemoApplication GitHub Repository to.


Agreement

For reading our license agreement and for further information about license plans, please visit www.dna-evolutions.com.


Authors

A product by dna-evolutions ©