diff --git a/README.md b/README.md index 55f5f76939bdbc94bf6023ca74c7ccabb7633c4e..8132a23fc9e3d44e74f8380fa5e3dcc3918ecc3b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Uses OpenAI API to determine if a research idea is reasonable and novel for the ## Deploy ### Docker-compose ``` -docker-compose up +docker-compose up --rebuild --force=recreate ``` You can use the `-d` flag at the end to runin in detached (background) mode @@ -17,4 +17,6 @@ To stop the app, ``` docker-compose down -``` \ No newline at end of file +``` + +or ctrl+c once to gracefully exit, twice to ungracefully exit. \ No newline at end of file diff --git a/app.py b/app.py index ac687ad75d65c632944f2af533dda89e08de72a0..2d6aae8cf1025aa6da7f6512a9a030fa2053c900 100644 --- a/app.py +++ b/app.py @@ -17,9 +17,13 @@ import os # secrets def manage_sensitive(name): + v1 = os.getenv(name) secret_fpath = f'/run/secrets/{name}' existence = os.path.exists(secret_fpath) + if v1 is not None: + return v1 + if existence: v2 = open(secret_fpath).read().rstrip('\n') return v2 diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 7a882fcff765741900dc12091f81e0b597d79058..d5ef46467a5c57d73550ff2ef8a49bee573d4b1e 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -19,7 +19,7 @@ RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ # Check if repo has been updated since last build ADD "https://gitlab.rc.uab.edu/anes_ai/mpog-helper-openai/commits?per_page=1" latest_commit RUN rm -rf latest_commit -RUN git clone -b feature/azure2 https://gitlab.rc.uab.edu/anes_ai/mpog-helper-openai.git . +RUN git clone https://gitlab.rc.uab.edu/anes_ai/mpog-helper-openai.git . #COPY .streamlit/secrets.toml /deploy/.streamlit/