You can but I've not found the value in the complexity. The CI container image already requires node and all the needed dev packages for tests to run anyway so I just run the precompile in the CI container after tests pass then copy the resulting `public` directory into the production container.
This also means the same exact environment is used to generate the production assets that was used to generate them for test.
This also means the same exact environment is used to generate the production assets that was used to generate them for test.