FROM ubuntu:noble AS build # The following does not work in Podman unless you build in Docker # compatibility mode: # You can manually prepend every RUN script with `set -ex` too. # SHELL ["sh", "-exc"] ### Start build prep. ### This should be a separate build container for better reuse. RUN < src/fastapi_dynamic_response/__about__.py touch README.md uv sync \ --locked \ --no-dev \ --no-install-project EOT # Now install the APPLICATION from `/src` without any dependencies. # `/src` will NOT be copied into the runtime container. # LEAVE THIS OUT if your application is NOT a proper Python package. # As of uv 0.4.11, you can also use # `cd /src && uv sync --locked --no-dev --no-editable` instead. COPY . /src RUN --mount=type=cache,target=/root/.cache \ uv pip install \ --python=$UV_PROJECT_ENVIRONMENT \ --no-deps \ /src ########################################################################## FROM ubuntu:noble # SHELL ["sh", "-exc"] # Optional: add the application virtualenv to search path. ENV PATH=/app/bin:$PATH # Don't run your app as root. RUN <. STOPSIGNAL SIGINT # Note how the runtime dependencies differ from build-time ones. # Notably, there is no uv either! RUN <