Precompiled assets across multiple production servers

(tim) #1

Question about precompiled assets on a multi-server production environment. The sprockets require_tree instruction does not define any ordering of its inclusions. On our two servers running identical code and identical versions of gems etc (same AWS AMI), the precompiled asset fingerprint is different due to the undefined nature of file system ordering.

I’m not a rails person normally so I have no intuition as to how people get around this problem normally. The require_directory sprockets command includes in lexicographical order, but does not recurse.

How is one meant to get around this problem for Discourse? Or is this not a problem and I have just misconfigured something incorrectly.


(Sam Saffron) #2

We build a docker image precompile in it and distribute to multiple machines

(tim) #3

Right, I see. How does the rails community get around this problem if they’re not using docker? Specify all folders with require_directory instead of require_tree?