What command/process builds the included assets?

What process creates the stylesheet assets during build, e.g. /stylesheets/color_definitions_dark_1_1_603243e2b6c0b7xydx234the00538538bd705.css

I’m assuming this is the process of bundling?

What might be going wrong if these are missing?

Should these start to exist as part of starting ember-cli or the rails server?

What approach should I take to build these in docker from the standard discourse image or should I expect them to exist by simply launching the servers?

1 Like

Stylesheets are built by the rails app on-demand, so in theory you don’t need to do anything manually.

Running bin/rake assets:precompile will compile them eagerly, which can be useful if you want to create an optimised docker image for rolling out to multiple hosts.

4 Likes

Thanks David that narrows down my investigation nicely

2 Likes

Aha! I’ve always wondered about that.

If they are on S3 and they get compiled on-demand, do they also get uploaded to S3?

2 Likes

Compiled-on-demand assets (e.g. stylesheets, theme-javascripts, svg-sprites) are not uploaded to S3. They are fetched directly from the application (or via the CDN_URL, if configured).

Static things like core/plugin JS and locales are generated by assets:precompile, and are guaranteed never to change at runtime.

2 Likes

I see; that helps explain why some stuff is served by the application. If there are multiple containers running (say, behind a load balancer), each of them will generate those on demand.

2 Likes

Yep, exactly. These things also tend to be cached in postgres/redis so they only need to be generated by the first app container to receive a request. The other containers can then cheaply fetch the compiled version from redis/postgres and write it to the filesystem.

2 Likes

And if there is a CDN, then they might not even need to, I guess.

I’m working with someone who seems to have an issue with some assets not loading (some icons are showing up really big) and I’m looking for some explanation.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.