Skip to content

Conversation

leonardow-unep-wcmc
Copy link
Contributor

@leonardow-unep-wcmc leonardow-unep-wcmc commented Aug 1, 2025

Changes

  • Node: Improve the Node.js installation process to ensure the correct version is installed.
  • database.yml: Updated to use environment variables. (Replaced by a copy in staging/production via the Capistrano deploy.)
  • storage.yml: Updated the ENV name to align with DevOps.
  • puma.rb: Updated to the latest Rails 8 copy.
  • Dockerfile: Optimised the size from 4GB down to 2.4GB
  • 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.
  • Sidekiq: Admin page password was previously managed via Nginx and .htaccess; moved to Rails credentials since this is application-level configuration.
  • Removed ALLOWED_HOSTS logic in staging/production environment files. I believe that just for development.

Notes

  • Dockerfile: Need hardcore --platform=linux/amd64 for chromium installed by puppeteer.
  • Dockerfile.deploy has been tested locally in production mode.
  • Environments secrets such as DB credentials, have been extracted from the existing server and added to the project’s GitHub Environments.
  • This project connect to 2 databases. The ENV for database is special.
  • Assets were previously served by Nginx; they’re now served by Puma. The RAILS_SERVE_STATIC_FILES environment variable has been added in config/deploy.yml.
  • The RAILS_LOG_TO_STDOUT environment variable has also been added in config/deploy.yml so that logs are written to stdout.

TODO

  • Remove Capistrano (not done yet).
  • Finalise staging and production server addresses (TBC).
  • Migrate the staging/production local files?

…o DevOps can make changes without developers; 2) assets:precompile without RAILS_MASTER_KEY not able to run coz failed to load credentials.
… production, it’s already run when the Docker image is built; Move it into the Docker Compose configuration for development only.
@leonardow-unep-wcmc leonardow-unep-wcmc requested a review from pdl August 1, 2025 16:18
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.

1 participant