Specify environment when precompiling assets

Fixes #1704

[ci skip]