From 9e1c9caec68011bf36f72e60ac7f05b538d1cf13 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Wed, 22 Jun 2022 11:56:36 +0100 Subject: [PATCH] Updated config to have defaults for keys Removed abstraction of data location for image build --- ref-test/Dockerfile | 2 ++ ref-test/app/config.py | 2 +- ref-test/install.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ref-test/Dockerfile b/ref-test/Dockerfile index 60cf232..719f3d2 100644 --- a/ref-test/Dockerfile +++ b/ref-test/Dockerfile @@ -1,4 +1,6 @@ FROM python:3.10-slim +ARG DATA=./data/ +ENV DATA=$DATA WORKDIR /ref-test COPY . . RUN pip install --upgrade pip && pip install -r requirements.txt diff --git a/ref-test/app/config.py b/ref-test/app/config.py index 0d1ac88..6bffff1 100644 --- a/ref-test/app/config.py +++ b/ref-test/app/config.py @@ -5,7 +5,7 @@ load_dotenv('../.env') class Config(object): APP_HOST = '0.0.0.0' - DATA = os.getenv('DATA') + DATA = './data/' DEBUG = False TESTING = False SECRET_KEY = os.getenv('SECRET_KEY') diff --git a/ref-test/install.py b/ref-test/install.py index 4570d59..e198996 100755 --- a/ref-test/install.py +++ b/ref-test/install.py @@ -8,10 +8,10 @@ from cryptography.fernet import Fernet from os import mkdir, path from pathlib import Path +data = Path(app.config.get('DATA')) database_uri = app.config.get('SQLALCHEMY_DATABASE_URI') with app.app_context(): - data = Path(app.config.get('DATA')) if not path.isdir(f'./{data}'): mkdir(f'./{data}') if not path.isdir(f'./{data}/questions'): mkdir(f'./{data}/questions') if not path.isfile(f'./{data}/.gitignore'):