From 129d266b16a2f4861d16cd60e8e6efc9bb0786d1 Mon Sep 17 00:00:00 2001 From: ol063fa Date: Sat, 19 Mar 2022 15:55:19 +0100 Subject: [PATCH] add z1 --- z1/README.md | 8 ++++++++ z1/docker-compose.yaml | 34 ++++++++++++++++++++++++++++++++++ z1/remove-app.sh | 7 +++++++ z1/start-app.sh | 7 +++++++ z1/stop-app.sh | 5 +++++ 5 files changed, 61 insertions(+) create mode 100644 z1/README.md create mode 100644 z1/docker-compose.yaml create mode 100644 z1/remove-app.sh create mode 100644 z1/start-app.sh create mode 100644 z1/stop-app.sh diff --git a/z1/README.md b/z1/README.md new file mode 100644 index 0000000..47940ee --- /dev/null +++ b/z1/README.md @@ -0,0 +1,8 @@ +**Základy klaudových technológií - Zadanie 1** +**Ondrej Ladomirják** + + +*Funkcionalita aplikácie* +Táto aplikácia slúži na správu NoSQL databázy MongoDB. Keďže práca s databázou cez príkazový riadok nie je veľmi "user-friendly", tak súčasťou je taktiež webové rozhranie pre správu databázy Mongo-Express, v ktorom možno vytvárať nové databázy a kolekcie, a pridávať do novovytvorených kolekcií potrebné záznami + +*Pomenované zväzky a virtuálna sieť* diff --git a/z1/docker-compose.yaml b/z1/docker-compose.yaml new file mode 100644 index 0000000..0873992 --- /dev/null +++ b/z1/docker-compose.yaml @@ -0,0 +1,34 @@ +version: '3' +services: + mongodb: + image: mongo + networks: + - mongo-network + container_name: mongodb + restart: always + ports: + - 27017:27017 + environment: + - MONGO_INITDB_ROOT_USERNAME=admin + - MONGO_INITDB_ROOT_PASSWORD=admin + volumes: + - mongo_data:/data/db + mongo-express: + image: mongo-express + networks: + - mongo-network + container_name: mongo-express + restart: always + ports: + - 8081:8081 + environment: + - ME_CONFIG_MONGODB_ADMINUSERNAME=admin + - ME_CONFIG_MONGODB_ADMINPASSWORD=admin + - ME_CONFIG_MONGODB_SERVER=mongodb +volumes: + mongo_data: + driver: local + name: mongo-db-data +networks: + mongo-network: + name: mongo-network-zct diff --git a/z1/remove-app.sh b/z1/remove-app.sh new file mode 100644 index 0000000..85b6f47 --- /dev/null +++ b/z1/remove-app.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +echo "Removing App :(" + +docker container rm mongodb mongo-express +docker volume rm mongo-db-data +docker network rm mongo-network-zct diff --git a/z1/start-app.sh b/z1/start-app.sh new file mode 100644 index 0000000..64dbfcf --- /dev/null +++ b/z1/start-app.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +docker-compose up -d + +echo "Running app ..." +echo "The app is available at http://localhost:8081" diff --git a/z1/stop-app.sh b/z1/stop-app.sh new file mode 100644 index 0000000..4d17d8c --- /dev/null +++ b/z1/stop-app.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +echo "Stopping App ..." +docker-compose stop