From 46d228c42ecf99943ad418d9af5fde9415463425 Mon Sep 17 00:00:00 2001 From: HeNine <> Date: Sun, 14 Nov 2021 10:08:51 +0100 Subject: [PATCH] preparing professor deployment --- build.sh | 1 + nginx/nginx.conf | 4 ++-- professor/script.js | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index c5b6299..d1dd20b 100644 --- a/build.sh +++ b/build.sh @@ -6,6 +6,7 @@ bash fetch_models.sh docker build -f buscribe/Dockerfile -t buscribe:$VERSION . docker build -f buscribe-api/Dockerfile -t buscribe-api:$VERSION . +docker build -f professor-api/Dockerfile -t professor-api:$VERSION . docker build -f docker-less/Dockerfile -t lessc . docker run --rm -v "$(pwd)"/buscribe-web:/buscribe-web lessc /buscribe-web/style.less > buscribe-web/style.css diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 695c8e0..610cb18 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -50,8 +50,8 @@ http { } location /buscribe/loadingreadyrun/json { proxy_pass http://buscribeapilrr:8010/buscribe/json; } - location /buscribe/desertbus/json { proxy_pass http://buscribeapidb:8010/buscribe/json; } - + location /buscribe/desertbus { proxy_pass http://buscribeapidb:8010/buscribe; } + location /professor/desertbus { proxy_pass http://professorapidb:8011/professor; } } } diff --git a/professor/script.js b/professor/script.js index a5b5331..1179750 100644 --- a/professor/script.js +++ b/professor/script.js @@ -27,7 +27,7 @@ function pageReady() { const bgOpacitySelector = document.querySelector('.vjs-bg-opacity > select'); bgOpacitySelector.value = "0.5" - fetch(`//localhost:8011/professor/line/${line_id}`) + fetch(`/professor/desertbus/line/${line_id}`) .then(response => response.json()) .then(fillLineInfo) .then(initializePlayer); @@ -84,11 +84,11 @@ function fillLineInfo(line_json) { function initializePlayer() { videojs.getPlayer("player").src([ - {src: `//localhost:8011/professor/line/${line_id}/playlist.m3u8`} + {src: `/professor/desertbus/line/${line_id}/playlist.m3u8`} ]); videojs.getPlayer("player").addRemoteTextTrack({ kind: "captions", - src: `//localhost:8010/buscribe/vtt?start_time=${line.start_time}&end_time=${line.end_time}`, + src: `/buscribe/desertbus/vtt?start_time=${line.start_time}&end_time=${line.end_time}`, srclang: "en", label: "English", default: true @@ -112,7 +112,7 @@ async function submit() { } } - return await fetch("//localhost:8011/professor/speaker", + return await fetch("/professor/desertbus/speaker", { method: "PUT", headers: { @@ -126,7 +126,7 @@ async function submit() { .pop(), 10)); })); - fetch(`//localhost:8011/professor/line/${line_id}`, + fetch(`/professor/desertbus/line/${line_id}`, { method: "POST", headers: { @@ -144,7 +144,7 @@ async function submit() { } $(function () { - fetch("//localhost:8011/professor/speaker") + fetch("/professor/desertbus/speaker") .then(response => response.json()) .then(function (speakers_json) { speakers = speakers_json;