Skip to content

vinstonpandiyan/spring-boot-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-docker

Spring-boot Docker example

Build Status Codacy Badge DockerHub

This is Spring-boot tomcat docker example,

Build docker image

docker build -t vinston/spring-boot-tomcat .

Run Docker image

docker run -P -d --name spring-boot-tomcat vinston/spring-boot-tomcat

New Features!

  • Play 2.4’s AES encryption now uses initialization vectors to randomize each encryption.
  • The Play encryption format has been changed to add support for initialization vectors.

You can also:

  • Download and Use the GitHub project for your learning purpose
  • Refer Play2 Site for more info: Play2 Crypto

Tech

Play2 Built-in Java Cryptographic Example uses a number of open source projects to work properly:

  • Play Framework - Play Framework makes it easy to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly architecture
  • [AngularJS] - HTML enhanced for web apps!
  • [node.js] - evented I/O for the backend
  • [Gulp] - the streaming build system

Installation

This example required the following tools to run

Install the dependencies and devDependencies and start the server.

$ mkdir examples
$ cd examples
$ git clone ssh://git@github.com/vinstonpandiyan/scalaplay2aesexample.git
$ cd scalaplay2aesexample
$ sbt run
$ cd examples/app/website
$ npm install -d
$ node app

Configuration

For using the play2 we need to generate the private key. Use and run the following steps to create the private key and copy paste the play2 application.conf file

  • Ex: play.crypto.secret="jhc_GPt:=uhJJYjEI00`5RkoB9C6kotmqb3iM9CVE]9jq:3t]>oOK2;MSzxmg?Uy"
$ sbt playGenerateSecret

OR

$ sbt play-generate-secret

For production environments...

$ npm install --production
$ npm run predeploy
$ NODE_ENV=production node app

Development

Use IntelliJ scala editor tool to develop the application, it is sweet and elagant way of development friendly tool.

  • Use Git to download the project
  • And use Scala Play SBT plugin to run the project

Use the following REST end point to test the AES crypto

CURL Example:

$ curl --request GET 'http://127.0.0.1:9000/app/play/encrypt?text=TEST_TEXT'
$ curl --request GET 'http://127.0.0.1:9000/app/play/decrypt?text=<ENCRYPTED _TEXT>'
$ curl --request GET 'http://127.0.0.1:9000/app/aes/encrypt?text=TEST_TEXT'
$ curl --request GET 'http://127.0.0.1:9000/app/aes/decrypt?text=<ENCRYPTED _TEXT>'

Running Test Spec

$ cd scalaplay2aesexample
$ sbt test

Building for source

For production release:

$ sbt build --prod

Docker

Releases

No releases published

Packages

No packages published

Languages