7

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.

akcasoy
  • 6,497
  • 13
  • 56
  • 100

1 Answers1

4

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:

  1. Install Java on your NAS
  2. 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)
  3. Now you can upload the jar-file
  4. 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.

markusgulden
  • 503
  • 1
  • 6
  • 18
  • thank you for your answer. Looks promising. And do you know how i can deploy my angular app (UI) ? – akcasoy Nov 03 '17 at 17:52
  • 1
    You can package and deploy Spring Boot app and GUI in one single jar. The following post explains how to setup a project from the scratch. See also some of the comments, there it is discussed in detail that both components are packaged in one single jar. https://blog.jdriven.com/2016/12/angular2-spring-boot-getting-started/#comment-290734 – markusgulden Nov 03 '17 at 19:24
  • i am very sorry, i forgot to mention that, my backend uses a MongoDB database.. do you somehow know whether i still can handle it without Docker? Quick google search with MongoDB results in answers where Docker is mentioned.. – akcasoy Nov 03 '17 at 21:28
  • by the way.. my Synology model is not supported :/ I think this is the dead end for my question. Thank you though! – akcasoy Nov 03 '17 at 22:31
  • Ok, sorry to hear that. Depending on your requirements, you could move to a database like MySQL or MariaDB (which is natively supported by Synology, in case you want to avoid buying new hardware). – markusgulden Nov 04 '17 at 08:34