# syntax=docker/dockerfile:1.9 FROM python3.13-slim-bookworm 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"] # Ensure apt-get doesn't open a menu on you. ENV DEBIAN_FRONTEND=noninteractive ### Start build prep. ### This should be a separate build container for better reuse. # RUN <. STOPSIGNAL SIGINT # Copy the pre-built `/app` directory to the runtime container # and change the ownership to user app and group app in one step. COPY --from=build --chown=app:app /app /app # If your application is NOT a proper Python package that got # pip-installed above, you need to copy your application into # the container HERE: COPY . /code USER app #WORKDIR /app # If python-packaged WORKDIR /code # If not python-packaged # Strictly optional, but I like it for introspection of what I've built # and run a smoke test that the application can, in fact, be imported. # RUN <