From 015a8877be951b0e1a97091f7849ea03e9d7ab04 Mon Sep 17 00:00:00 2001 From: msm-cert <156842376+msm-cert@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:04:38 +0000 Subject: [PATCH] Fix static file dir in the dev builds (#415) --- deploy/docker/dev.web.Dockerfile | 15 +++------------ src/app.py | 1 + 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/deploy/docker/dev.web.Dockerfile b/deploy/docker/dev.web.Dockerfile index 24c037e7..6d45ab8f 100644 --- a/deploy/docker/dev.web.Dockerfile +++ b/deploy/docker/dev.web.Dockerfile @@ -1,20 +1,11 @@ -FROM node:18 AS build - -RUN npm install -g serve -COPY src/mqueryfront /app -WORKDIR /app -RUN npm install --legacy-peer-deps && npm run build - FROM python:3.10 +WORKDIR /usr/src/app/src + RUN apt update; apt install -y cmake # mquery and plugin requirements COPY requirements.txt src/plugins/requirements-*.txt /tmp/ RUN ls /tmp/requirements*.txt | xargs -i,, pip --no-cache-dir install -r ,, -COPY requirements.txt setup.py MANIFEST.in /usr/src/app/ -COPY src /usr/src/app/src/ -COPY --from=build "/app/dist" "/usr/src/app/src/mqueryfront/dist" -RUN pip3 install /usr/src/app -CMD uvicorn mquery.app:app --host 0.0.0.0 --port 5000 --reload +CMD pip install -e /usr/src/app && uvicorn mquery.app:app --host 0.0.0.0 --port 5000 --reload diff --git a/src/app.py b/src/app.py index 761c50a9..6855f077 100644 --- a/src/app.py +++ b/src/app.py @@ -595,6 +595,7 @@ def serve_index_sub() -> FileResponse: directory=os.path.join( os.path.dirname(__file__), "mqueryfront", "dist" ), + check_dir=False, html=True, ), )