Skip to content

Commit

Permalink
+Added how_to_use_app.txt since we now need to attach to docker in or…
Browse files Browse the repository at this point in the history
…der to give inputs to application.

+Fixed docker-compose.yml to allow for user input.

Signed-off-by: M6xxy <79139144+M6xxy@users.noreply.github.com>
  • Loading branch information
M6xxy committed Nov 25, 2024
1 parent 358936f commit ef21447
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ services:
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
ports:
- "8080:8080"
stdin_open: true # Allows for system.in to work properly
tty: true # Allows for system.in to work properly
depends_on:
- mysql
networks:
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/group8/project_files/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ public static void main(String[] args) {
Database db = new Database();
Menu userMenu = new Menu();

// Create scanner for text
Scanner userScanner =new Scanner(System.in);

// Connect to DB and test
db.initDB();

// Create scanner for text
Scanner scanner = new Scanner(System.in);
// Start Menu
userMenu.start(userScanner);
userMenu.start(scanner);

}
}
4 changes: 2 additions & 2 deletions src/main/java/group8/project_files/Menu.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ public class Menu {

/**
* A simple menu that allows the user to select 1-5 menu options or they can type exit to leave the menu / application
* @param scanner takes in a scanner
*
*/
public void start(Scanner scanner) {
String input; // Variable to store the user's input
String input = ""; // Variable to store the user's input

// Infinite loop to repeatedly display the menu until "exit" is typed
while (true) {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/group8/project_files/how_to_use_app.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
IN CMD INPUT WHILE CONTAINER ACTIVE

docker attach java-container

NOW ANY INPUTS YOU PUT IN WILL SHOW UP ON INTELLIJ LOG AND APPLICATION WILL RESPOND TO INPUTS!

0 comments on commit ef21447

Please sign in to comment.