diff --git a/docker/api.Dockerfile b/docker/api.Dockerfile index 1bf3af5..2acb772 100644 --- a/docker/api.Dockerfile +++ b/docker/api.Dockerfile @@ -17,7 +17,11 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* COPY pyproject.toml ./ COPY app ./app -RUN pip install --no-cache-dir . +# Editable install so site-packages resolves `app` by absolute path (/app) +# rather than a frozen copy — consistent with worker.Dockerfile, and keeps +# this correct even though uvicorn --reload happens to resolve its own +# import string against the CWD regardless. +RUN pip install --no-cache-dir -e . FROM base AS runtime RUN useradd --create-home --uid 1000 aurora diff --git a/docker/worker.Dockerfile b/docker/worker.Dockerfile index a525904..92b1e84 100644 --- a/docker/worker.Dockerfile +++ b/docker/worker.Dockerfile @@ -17,7 +17,14 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* COPY pyproject.toml ./ COPY app ./app -RUN pip install --no-cache-dir . +# Editable install: site-packages ends up pointing at this /app directory by +# absolute path rather than a frozen copy of it. That matters because the +# `arq` console-script (unlike uvicorn --reload, which explicitly resolves +# its app import against the CWD) just imports whatever site-packages says +# `app` is — a non-editable install would permanently freeze the worker's +# code at whatever this build saw, silently ignoring the dev bind mount +# (docker-compose.yml's `./app:/app/app`) on every later `restart`. +RUN pip install --no-cache-dir -e . FROM base AS runtime RUN useradd --create-home --uid 1000 aurora