ambitious-artist-52780
07/19/2023, 11:40 AMbroad-processor-92400
07/19/2023, 12:02 PMcareful-address-89803
07/19/2023, 6:15 PMRUN ./pants package "$APPLICATION"
you can do `COPY path.to.application/binary.pex /bin/app`to copy in the built PEX. Pants uses dependency inference to package the PEX binary. by default this includes all the dependencies, so you can skip the RUN pip3 install -r requirements.txt
(and all the engineering time optimising it to not cache the wheels). We have a handful of small apps and found that was fine speed-wise since we hit the Pants cache instead of the docker cache. We found that there was a bit of a slowdown because the PEX contains all of the dependencies as an opaque file, so we had to copy&upload&store MiB instead of KiB. That was only really a problem for us with 1 of our apps (it was an integration thing, so the only way to really dev was to push it into a staging env). We followed the steps in the article Huon linked to use 2 PEXes.
Our dev throughput isn't very high, though, so our focus is really on Dev Experience rather than build performance.