From faa06005977e8e576eb75a904efa927fffe9d518 Mon Sep 17 00:00:00 2001 From: strokh24 <Rokas.Stankunas@Student.Reutlingen-University.DE> Date: Wed, 6 Nov 2024 22:11:46 +0100 Subject: [PATCH] Updated deployment instructions --- README.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8400ba2..6cdcbf5 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ e.g., using BCRYPT) Develop a TODO app that fulfills the requirements from above. You can use any language and framework that you want. The app needs to be connected to a database to store the TODO -lists. **Use MongoDB as the database.** +lists. Use MongoDB as the database. --- ## Prerequisites - Git @@ -32,11 +32,19 @@ In exercise 1, the deployment consisted of 2 parts: deploying the database and t `git clone https://gitlab.reutlingen-university.de/gajesh24/cloudcomputing_act1.git` 2. Enter the folder: `cd cloudcomputing_act1` -3. Build the image: -`sudo docker build -t todo-app .` -4. Start docker compose file -`sudo docker compose up -d` -5. Open up website on `http://localhost/` +3. Create .env file with the following contents: +` +MONGO_INITDB_ROOT_USERNAME=mongoAdmin +MONGO_INITDB_ROOT_PASSWORD=someRandomPassword123 +MONGO_URI=mongodb://$MONGO_INITDB_ROOT_USERNAME:$MONGO_INITDB_ROOT_PASSWORD@mongodb:27017/todo-app?authSource=admin +` +4. Build the application +`sudo docker compose build` +5. Run the application +`sudo docker compose --env-file .env up -d` +6. Open up website on `http://localhost/` +7. To stop the application +`sudo docker compose stop` --- ## Authors -- GitLab