File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Installation Guide for Spring Backend Application in Ubuntu Instance
2+
3+ This guide provides step-by-step instructions for setting up and running a Spring backend application on Ubuntu.
4+
5+ ## Prerequisites
6+ - Ubuntu operating system
7+ - Internet connection
8+
9+ ## Instructions
10+
11+ 1 . ** Update apt package index:**
12+
13+ ``` bash
14+ sudo apt update
15+ ```
16+
17+ 2. ** Install OpenJDK 8:**
18+
19+ ` ` ` bash
20+ sudo apt install openjdk-8-jdk
21+ ` ` `
22+
23+ 3. ** Install Maven:**
24+
25+ ` ` ` bash
26+ sudo apt install maven
27+ ` ` `
28+
29+ 4. ** Build the project using Maven:**
30+
31+ ` ` ` bash
32+ mvn clean package -Dmaven.test.skip=true
33+ ` ` `
34+
35+ 5. ** Run the application:**
36+
37+ ` ` ` bash
38+ java -jar target/spring-backend-v1.jar
39+ ` ` `
40+
41+ # # Notes
42+ - Make sure you have the necessary permissions to execute the commands with ` sudo` .
43+ - Ensure that you have the appropriate Java and Maven versions compatible with your Spring application.
44+ - Adjust the file paths and application names as per your project' s structure.
45+
46+ Feel free to modify this guide according to your specific requirements.
47+
48+ ## Dockefile
49+ ```dockerfile
50+ # Use Ubuntu as base image
51+ FROM ubuntu:latest
52+
53+ # Install dependencies
54+ RUN apt-get update && \
55+ apt-get install -y openjdk-8-jdk maven && \
56+ rm -rf /var/lib/apt/lists/*
57+
58+ # Set the working directory in the container
59+ WORKDIR /app
60+
61+ # Copy the Maven project directory into the container
62+ COPY . /app
63+
64+ # Build the Maven project
65+ RUN mvn clean package -Dmaven.test.skip=true
66+
67+ # Expose the port the application runs on
68+ EXPOSE 8080
69+
70+ # Command to run the application
71+ CMD ["java", "-jar", "target/spring-backend-v1.jar"]
72+ ```
You can’t perform that action at this time.
0 commit comments