From a97c95f762094e24d824a757f467f485db8b644b Mon Sep 17 00:00:00 2001 From: cami Date: Sat, 24 Jul 2021 01:08:17 +0200 Subject: [PATCH 1/3] Bumped version of mongodb --- docker-compose.prod.yml | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 10c3e2d..ec741e6 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -20,6 +20,6 @@ services: environment: - MONGO_URI=mongodb://mongodb:27017/behametrics mongodb: - image: mongo:4.0.1 + image: mongo:4.0.25 container_name: "behametrics-mongo" command: mongod --smallfiles diff --git a/docker-compose.yml b/docker-compose.yml index 46dafc3..deac250 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,6 @@ services: environment: - MONGO_URI=mongodb://mongodb:27017/behametrics mongodb: - image: mongo:4.0.1 + image: mongo:4.0.25 container_name: "behametrics-mongo" command: mongod --smallfiles From 8bb37bbc210afb8ae947f84e22f4b86524b80eab Mon Sep 17 00:00:00 2001 From: cami Date: Sat, 24 Jul 2021 02:11:17 +0200 Subject: [PATCH 2/3] Updated to upstream --- docker-compose.prod.yml | 2 ++ frontend/src/components/pages/Study.jsx | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index ec741e6..9c7cbf9 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -8,6 +8,8 @@ services: backend-prod: image: caminsha/bt-backend container_name: backend-prod + volumes: + - "./database.db:/app/database.db:z" environment: DEBUG: "no" PORT: 5050 diff --git a/frontend/src/components/pages/Study.jsx b/frontend/src/components/pages/Study.jsx index 48e4718..92de04d 100644 --- a/frontend/src/components/pages/Study.jsx +++ b/frontend/src/components/pages/Study.jsx @@ -110,11 +110,9 @@ export default function Study() { setState(STATES.NORMAL); handleLoggerOn(); // map username and session with the logs - _logger.current.logCustomEvent( - { - name: serverUsername, - }, - ); + _logger.current.logCustomEvent({ + name: serverUsername, + }); }; const resetInputValues = () => { From c5b595ad400ba9eeb6782712af516c5b1ac99863 Mon Sep 17 00:00:00 2001 From: cami Date: Sun, 25 Jul 2021 00:05:11 +0200 Subject: [PATCH 3/3] Updated some things for infrastructure --- backend/Dockerfile | 2 ++ backend/Dockerfile.prod | 2 ++ requests.sh | 12 ++++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 8eb7a25..8c2b849 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -4,6 +4,8 @@ WORKDIR /app COPY requirements.txt . +RUN apk install sqlite3 + RUN pip install -r requirements.txt COPY /src . diff --git a/backend/Dockerfile.prod b/backend/Dockerfile.prod index 1bd4a72..3e3875f 100644 --- a/backend/Dockerfile.prod +++ b/backend/Dockerfile.prod @@ -6,6 +6,8 @@ RUN apt-get -y update && apt-get -y upgrade COPY requirements.txt . +RUN apk install sqlite3 + RUN pip install -r requirements.txt COPY /src . diff --git a/requests.sh b/requests.sh index 6cfb89a..ff77321 100755 --- a/requests.sh +++ b/requests.sh @@ -2,7 +2,7 @@ ACTION=$1 VALUE=$2 -ACTIONS=(login register rcvpw username data csv) +ACTIONS=(login register rcvpw username data csv prod_data prod_csv) print_help(){ echo "Usage: $0 ACTION [TOKEN|INPUT_TYPE]" @@ -41,9 +41,17 @@ case $ACTION in curl localhost:5000/data ;; "${ACTIONS[5]}") # get all data from behametricsserver - echo "get data action" + echo "get csv from input action" curl localhost:5000/data/csv/"${VALUE}" ;; + "${ACTIONS[6]}") # get all data from behametricsserver + echo "get prod data action" + curl behavior.marcocamenzind.ch:5000/data + ;; + "${ACTIONS[7]}") # get all data from behametricsserver + echo "get prod csv from input action" + curl behavior.marcocamenzind.ch:5000/data/csv/"${VALUE}" + ;; *) echo "Error: Action not available" echo