diff --git a/Dockerfile b/Dockerfile index f6a5d23..3a35800 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,6 @@ COPY ./requirements.txt /tmp/requirements.txt RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt -RUN echo "first_run" > "first_run" +RUN echo "first_run" > "/tmp/first_run" CMD ["fastapi", "run", "app/main.py", "--proxy-headers", "--port", "80", "--reload"] \ No newline at end of file diff --git a/app/main.py b/app/main.py index 822269d..a2ceb21 100644 --- a/app/main.py +++ b/app/main.py @@ -19,7 +19,7 @@ from starlette.middleware import Middleware from starlette_context import context, plugins from starlette_context.middleware import RawContextMiddleware -if os.path.isfile("first_run") and (os.environ.get("RELOAD_ON_FIRST_RUN", "").lower() == "true"): +if os.path.isfile("/tmp/first_run") and (os.environ.get("RELOAD_ON_FIRST_RUN", "").lower() == "true"): print("First run ... load data") with SessionLocal() as db: asyncio.run(admin.create_upload_file(include_non_singable=True, db=db))