Skip to content

Conversation

leonardow-unep-wcmc
Copy link

@leonardow-unep-wcmc leonardow-unep-wcmc commented Jul 16, 2025

Changes

  • Ruby: Upgraded from 2.3.1 to 2.6.10.
  • deploy/: Added a folder containing its own Gemfile and .ruby-version to pin the Ruby and Kamal versions for deployment.
  • Kamal configs: Added Kamal configuration files.
  • Kamal pre-build hook: Enabled the pre-build hook in Kamal.

Notes

  • In the Dockerfile, the Ruby image must specify --platform=linux/amd64 because the libv8 gem does not support ARM.
  • Run docker compose up -d to start the local development environment.
  • The final Docker image for both staging and production is based on Nginx.

Nginx

  • Although this repo README.md mentions an Nginx rewrite, I can’t find it on the staging or production servers, so I assume it isn’t necessary.
  • The official Nginx default configuration is used, which should allow serving any domain on port 80.
  • In the current staging/production Nginx configuration, Passenger is running with Ruby 2.2.2 and has a special handler for the /assets/ folder. However, based on my testing, this is a JavaScript-only frontend project—it doesn’t require Ruby at runtime and there is no /assets/ directory. It’s likely that a previous DevOps engineer simply reused a configuration from another project. That’s why I insist that we include exactly what’s needed—no more and no less—rather than piling on every setting that “seems” harmless. Future developers or DevOps engineers will otherwise have a hard time determining which directives are actually in use and which can be safely removed.

TODO

  • Remove Capistrano (not done yet).
  • Finalise staging and production server addresses (TBC).

…er images for any version prior to 2.6 are too old, so the apt command no longer works.
…stead of rakep server so we can specify the binding host.
@leonardow-unep-wcmc leonardow-unep-wcmc requested a review from pdl July 16, 2025 08:18
@leonardow-unep-wcmc leonardow-unep-wcmc marked this pull request as draft July 16, 2025 08:26
@pdl
Copy link
Contributor

pdl commented Jul 21, 2025

I have had issues - which Leo cannot reproduce - where some of js/app.js, js/minispade.js, js/handlebars.js randomly took > 30s and timed out. The workaround seems to be docker compose down -v (the resulting up will take quite a while as gems will need to be donwloaded).

@leonardow-unep-wcmc leonardow-unep-wcmc marked this pull request as ready for review July 21, 2025 14:37
@leonardow-unep-wcmc leonardow-unep-wcmc changed the title Dockerise Dockerise and Kamal 2 Jul 21, 2025
@pdl
Copy link
Contributor

pdl commented Jul 21, 2025

Looks good to me, but need new machines to verify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants