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'):