Can I build a separate image/container for other devices to use?

AI-generated summary

Building a Separate Image/Container for Other Devices to Use

The discussion revolves around building a separate image/container for other devices to use, specifically to accelerate the construction process by reducing compilation time. wszgrcy is looking for tutorials or guidance on implementing this approach.

NateDhaliwal suggests that the Discourse team uses a similar approach for their hosted product, but notes that there is no official documentation available.

pfaffman provides a general outline of the steps involved, including bootstrapping, pushing the image to a repository, and using ./launcher start-cmd to set up the container. Additionally, pfaffman mentions the importance of migrating the database, precompiling assets, and pushing them to S3 (if applicable).

  • Assuming all configurations remain unchanged (build and start the same)
  • To accelerate the construction process I hope to build an image on a dedicated packaging server and upload it to Harbor, then download it before using the pre built image to reduce compilation time
  • May I ask if there are any relevant tutorials that can be implemented in this way? Or can it be implemented on its own but there is no official support and it needs to be explored on its own?

I think the Discourse team does something like that for their hosted product, so you can get your forum up with them within minutes (it would be really inefficient if the user has to wait for everything to install, right?). I don’t think there’s Documentation for this, though.

I’m not aware of a guide, but basically, you do a bootstrap, push that image to your repo, and then use ./launcher start-cmd to get the required ENV to crank up the container.

At some point you need to migate the database (if you want a zero-downtime deployment, you want to know about SKIP_POST_DEPLOYMENT_MIGRATIONS to enable you to migrate the database while the old container runs and rake db:ensure_post_migrations db:migrate after it’s launched. You also need to precompile assets and, if you’re using S3, push them there.

That’s at least most of the Discourse-specific pieces. If you would like more help and have a budget, I’m available.