From 73e5b94eea8726affe991699b7227f8d91279153 Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Sun, 9 Mar 2025 14:41:13 +0100 Subject: [PATCH] Do a first run inside Dockerfile to create .pyc files --- Dockerfile | 2 ++ Dockerfile.ci | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index d6f0ae8d..b5e7802b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,6 +44,8 @@ ENV PYTHONUNBUFFERED=1 RUN useradd --create-home locust # ensure correct permissions RUN chown -R locust /opt/venv +# perform initial bytecode compilation (brings down total startup time from ~0.9s to ~0.6s) +RUN locust --version USER locust WORKDIR /home/locust EXPOSE 8089 5557 diff --git a/Dockerfile.ci b/Dockerfile.ci index fb709a98..68dc02fd 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -23,6 +23,8 @@ ENV PYTHONUNBUFFERED=1 RUN useradd --create-home locust # ensure correct permissions RUN chown -R locust /opt/venv +# perform initial bytecode compilation (brings down total startup time from ~0.9s to ~0.6s) +RUN locust --version USER locust WORKDIR /home/locust EXPOSE 8089 5557