I should skip the precompile

Hi,

I should skip [bundle exec rake assets:precompile] process in ./laucher boostrap app for security reasons that should not access the database.

I just edit web-template for skipping this, it does succeeded in executing discourse.
But, there are only empty screen. there are something wrong in assets like this

discourse-details.js:1 Failed to load resource: the server responded with a status of 404 ()
discourse-local-dates.js:1 Failed to load resource: the server responded with a status of 404 ()
discourse-presence.js:1 Failed to load resource: the server responded with a status of 404 ()
discourse-narrative-bot.js:1 Failed to load resource: the server responded with a status of 404 ()
docker_manager.js:1 Failed to load resource: the server responded with a status of 404 ()
lazy-yt.js:1 Failed to load resource: the server responded with a status of 404 ()
poll.js:1 Failed to load resource: the server responded with a status of 404 ()
discourse-presence.js:1 Failed to load resource: the server responded with a status of 404 ()
docker_manager.js:1 Failed to load resource: the server responded with a status of 404 ()
lazy-yt.js:1 Failed to load resource: the server responded with a status of 404 ()
poll.js:1 Failed to load resource: the server responded with a status of 404 ()

ref : Rake assets:precompile without database

We store the themes in the database (they are edited in the admin UI) so the CSS is inside PostgreSQL so you need the database connection at build time to be able to precompile those.

so I just succeed ‚Äúprecompile‚ÄĚ with no-security zone with same db, and it run great.
and I checked there are themes, css in the DB successfully.

I connected to ‚Äúnon-precompile‚ÄĚ server in the same db, but I failed got the css, js, theme file.

I wanna copy&paste assets files on the no-security zone to target zone server.
what path-directory should I paste? or anything should I do for this?

Or‚Ķ Is there any thing to do get assets(theme, css, js‚Ķ) with skipping ‚Äúprecompile‚ÄĚ ?

I look forward to your prompt reply. thank you.

1 Like

Discourse is not supported in such a configuration. The assets that require database access do get dynamically rebuilt after changes while the app is started, but they share the same asset pipeline so need to get precompiled at the same time as everything else.

Attempting to skip asset precompile would mean you get only the dynamic assets, and none of the core ones.

3 Likes