Le immagini server e client non portano vendor/visionsuite: ogni uv run rivalidava il progetto e falliva. UV_NO_SYNC=1 usa il venv di uv sync. La cache uv creata da root in build va ceduta all'utente app. Verificato con build e run delle due immagini. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -20,6 +20,10 @@ RUN useradd -m -u 10001 app
|
|||||||
# Independent of $HOME regardless: keeps the cache path explicit and writable
|
# Independent of $HOME regardless: keeps the cache path explicit and writable
|
||||||
# by the app user even if the home directory assumption ever changes.
|
# by the app user even if the home directory assumption ever changes.
|
||||||
ENV UV_CACHE_DIR=/tmp/uv-cache
|
ENV UV_CACHE_DIR=/tmp/uv-cache
|
||||||
|
# `uv run` must use the venv built by `uv sync` below as it is: re-validating
|
||||||
|
# the project would look for vendor/visionsuite (the vision-worker extra), which
|
||||||
|
# this image does not carry (issue 39). `uv sync` itself is not affected by it.
|
||||||
|
ENV UV_NO_SYNC=1
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -36,7 +40,7 @@ COPY src/ ./src/
|
|||||||
|
|
||||||
# Uploads directory (mounted as a volume in production).
|
# Uploads directory (mounted as a volume in production).
|
||||||
RUN mkdir -p /app/uploads/images /app/uploads/pdfs /app/uploads/logos /app/uploads/reports \
|
RUN mkdir -p /app/uploads/images /app/uploads/pdfs /app/uploads/logos /app/uploads/reports \
|
||||||
&& chown -R app:app /app
|
&& chown -R app:app /app /tmp/uv-cache
|
||||||
|
|
||||||
USER app
|
USER app
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -25,6 +25,10 @@ RUN useradd -m -u 10001 app
|
|||||||
# Independent of $HOME regardless: keeps the cache path explicit and writable
|
# Independent of $HOME regardless: keeps the cache path explicit and writable
|
||||||
# by the app user even if the home directory assumption ever changes.
|
# by the app user even if the home directory assumption ever changes.
|
||||||
ENV UV_CACHE_DIR=/tmp/uv-cache
|
ENV UV_CACHE_DIR=/tmp/uv-cache
|
||||||
|
# `uv run` must use the venv built by `uv sync` below as it is: re-validating
|
||||||
|
# the project would look for vendor/visionsuite (the vision-worker extra), which
|
||||||
|
# this image does not carry (issue 39). `uv sync` itself is not affected by it.
|
||||||
|
ENV UV_NO_SYNC=1
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -41,7 +45,7 @@ COPY --from=tailwind-build /app/flask_app/static/css/tailwind.css ./flask_app/st
|
|||||||
# Compile Flask-Babel translation catalogs.
|
# Compile Flask-Babel translation catalogs.
|
||||||
WORKDIR /app/flask_app
|
WORKDIR /app/flask_app
|
||||||
RUN uv run --project /app pybabel compile -d translations && \
|
RUN uv run --project /app pybabel compile -d translations && \
|
||||||
chown -R app:app /app
|
chown -R app:app /app /tmp/uv-cache
|
||||||
|
|
||||||
USER app
|
USER app
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ RUN test -n "$VISION_ENGINE_VERSION" || { \
|
|||||||
}
|
}
|
||||||
ENV VISION_ENGINE_VERSION=${VISION_ENGINE_VERSION}
|
ENV VISION_ENGINE_VERSION=${VISION_ENGINE_VERSION}
|
||||||
|
|
||||||
RUN chown -R app:app /app
|
RUN chown -R app:app /app /tmp/uv-cache
|
||||||
USER app
|
USER app
|
||||||
|
|
||||||
EXPOSE 8100
|
EXPOSE 8100
|
||||||
|
|||||||
Reference in New Issue
Block a user