Do a first run inside Dockerfile to create .pyc files

This commit is contained in:
Lars Holmberg 2025-03-09 14:41:13 +01:00
parent 4c24bac302
commit 73e5b94eea
2 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,8 @@ ENV PYTHONUNBUFFERED=1
RUN useradd --create-home locust RUN useradd --create-home locust
# ensure correct permissions # ensure correct permissions
RUN chown -R locust /opt/venv 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 USER locust
WORKDIR /home/locust WORKDIR /home/locust
EXPOSE 8089 5557 EXPOSE 8089 5557

View File

@ -23,6 +23,8 @@ ENV PYTHONUNBUFFERED=1
RUN useradd --create-home locust RUN useradd --create-home locust
# ensure correct permissions # ensure correct permissions
RUN chown -R locust /opt/venv 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 USER locust
WORKDIR /home/locust WORKDIR /home/locust
EXPOSE 8089 5557 EXPOSE 8089 5557