Skip to content

Commit

Permalink
Dockerfile: set UV_COMPILE_BYTECODE=1
Browse files Browse the repository at this point in the history
> By default, uv does not compile Python (.py) files
> to bytecode (__pycache__/*.pyc); instead, compilation
> is performed lazily the first time a module is imported.
> For use-cases in which start time is critical, such as
> CLI applications and Docker containers, this option can
> be enabled to trade longer installation times for faster
> start times.

Without this we will see increased startup times for apps which can in
turn break the dev envs, where instances have reduced cpu and can’t
compile all their bytecode in time to return a healthcheck.
  • Loading branch information
quis committed Dec 11, 2024
1 parent bd9430a commit 2a6acda
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ENV CLAMAV_MIRROR_URL https://s3.eu-west-1.amazonaws.com/notifications.service.g
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
ENV UV_CACHE_DIR='/tmp/uv-cache/'
ENV UV_COMPILE_BYTECODE=1


# Use clamav database from private mirror. Disable with: --build-arg CLAMAV_USE_MIRROR=false for local builds
Expand Down

0 comments on commit 2a6acda

Please sign in to comment.