Skip to content

Create server and deploy application on DigitalOcean

Notifications You must be signed in to change notification settings

sidor2/devops-module5-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project: Create server and deploy application on DigitalOcean

Technologies used:

  • DigitalOcean
  • Linux
  • Java
  • Gradle

Project Requirements:

  • Setup and configure a server on DigitalOcean
  • Create and configure a new Linux user on the Droplet (Security best practice)
  • Deploy and run Java Gradle application on Droplet

Implementation Steps:

Create Droplet Add SSH Key Create FW with SSH Add FW to Droplet

$ ssh -i .ssh/digitalocean root@137.184.120.168

in Droplet

~# apt update
~# apt upgrade
~# apt install openjdk-8-jre-headless

create a user

~# adduser application
~# usermod -aG sudo application
~# su - application
$ mkdir .ssh
$ sudo vim .ssh/authorized_keys
  • copy the public ssh key into the newly created authorized_keys file

Locally

gradle build
scp -i /home/<user>/.ssh/digitalocean build/libs/devops-module5-project.jar root@137.184.120.168:/home/application
$ ssh -i .ssh/digitalocean application@137.184.120.168

In Droplet

$ java -jar devops-module5-project.jar &

...
2023-10-11 20:55:35.183  INFO 26741 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 7071 (http)
...

Add HTTP in FW

$ ps aux | grep java
$ netstat -lpnt

in Droplet for Nexus

About

Create server and deploy application on DigitalOcean

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •