Fix dev compose: API PYTHONPATH and web volume permissions
API: bake ENV PYTHONPATH=/app/src into the development Dockerfile stage so it's available to uvicorn's WatchFiles reloader subprocess — relying on compose env vars isn't reliable across process forks. Web: replace ./web:/app bind mount (caused EACCES in Podman rootless due to UID mismatch) with ./web/src:/app/src — this preserves the container's package.json and node_modules while still giving Vite live access to source files for HMR. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ WORKDIR /app
|
|||||||
RUN pip install uv
|
RUN pip install uv
|
||||||
|
|
||||||
FROM base AS development
|
FROM base AS development
|
||||||
|
ENV PYTHONPATH=/app/src
|
||||||
COPY pyproject.toml .
|
COPY pyproject.toml .
|
||||||
RUN uv sync
|
RUN uv sync
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ services:
|
|||||||
SECRET_KEY: ${SECRET_KEY:-replace_me_with_32_byte_hex_default}
|
SECRET_KEY: ${SECRET_KEY:-replace_me_with_32_byte_hex_default}
|
||||||
INTERNAL_SECRET: ${INTERNAL_SECRET:-replace_me_with_32_byte_hex_default}
|
INTERNAL_SECRET: ${INTERNAL_SECRET:-replace_me_with_32_byte_hex_default}
|
||||||
DOMAIN: ${DOMAIN:-localhost}
|
DOMAIN: ${DOMAIN:-localhost}
|
||||||
PYTHONPATH: /app/src
|
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
networks:
|
networks:
|
||||||
@@ -50,8 +49,7 @@ services:
|
|||||||
context: ./web
|
context: ./web
|
||||||
target: development
|
target: development
|
||||||
volumes:
|
volumes:
|
||||||
- ./web:/app
|
- ./web/src:/app/src
|
||||||
- /app/node_modules
|
|
||||||
environment:
|
environment:
|
||||||
API_URL: http://api:8000
|
API_URL: http://api:8000
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
Reference in New Issue
Block a user