Skip to content

Dockerfile should first copy requirements.txt and install dependencies before copying agent code #6923

Description

@idofl

# Copy agent - Start

In the current structure of the Dockerfile, the build first creates a layer with the agent's code, and then creates another layer with the installed dependencies. This order of operations causes the build process to re-create the dependencies layer after every code change, even if the list of dependencies in the requirements.txt hasn't changed.

The correct order should be:

  1. copy only requirements.txt file.
  2. run pip install to download dependencies
  3. copy agent code

This should reduce the amount of time it takes to build container images when redeploying updated agent code, as long as the dependencies list doesn't change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions