From 9c248a194d175052fc183df3a756ee0afa808954 Mon Sep 17 00:00:00 2001 From: Akbar Rahman Date: Wed, 27 Dec 2023 23:59:40 +0000 Subject: [PATCH] use user uid 1000 --- Dockerfile | 8 ++++++++ index.html | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index bb3b8bb..d69ca13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,4 +13,12 @@ RUN apt update && apt install -y ffmpeg libsm6 libxext6 COPY src . COPY best.pt /best.pt +RUN chown -R 1000 /usr/src/app +RUN mkdir /.config +RUN mkdir /.cache +RUN chown -R 1000 /.config +RUN chown -R 1000 /.cache + +USER 1000 + CMD [ "gunicorn", "-b 0.0.0.0:80", "--workers", "1", "app:app" ] diff --git a/index.html b/index.html index 8a7854e..fdc4d3a 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@

submit an image to get started!

-
+
@@ -38,11 +38,11 @@ console.log(id); while (true) { - const resp = await fetch('http://localhost:8759/state/' + id); + const resp = await fetch('https://glass.alv.cx/state/' + id); const state = (await resp.json()).state; statusline.innerHTML = state; if (state == "READY") { - img.src = 'http://localhost:8759/result/' + id + img.src = 'https://glass.alv.cx/result/' + id return; } }