{"id":21991922,"url":"https://github.com/elct9620/boxing","last_synced_at":"2025-04-04T15:08:08.446Z","repository":{"id":39984773,"uuid":"439657278","full_name":"elct9620/boxing","owner":"elct9620","description":"The zero-configuration Dockerfile generator for Ruby.","archived":false,"fork":false,"pushed_at":"2025-01-13T13:20:45.000Z","size":183,"stargazers_count":64,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T14:06:23.516Z","etag":null,"topics":["docker","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elct9620.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-18T16:03:51.000Z","updated_at":"2025-01-13T13:20:47.000Z","dependencies_parsed_at":"2024-09-11T18:24:31.813Z","dependency_job_id":"de407f03-2066-4d09-a46b-dc571c0eab6d","html_url":"https://github.com/elct9620/boxing","commit_stats":{"total_commits":113,"total_committers":3,"mean_commits":"37.666666666666664","dds":0.1327433628318584,"last_synced_commit":"8b4b4770d1326c40517529ed9dc1bc84cf5da0c4"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elct9620%2Fboxing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elct9620%2Fboxing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elct9620%2Fboxing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elct9620%2Fboxing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elct9620","download_url":"https://codeload.github.com/elct9620/boxing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198450,"owners_count":20900080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","rails","ruby"],"created_at":"2024-11-29T20:12:10.963Z","updated_at":"2025-04-04T15:08:08.428Z","avatar_url":"https://github.com/elct9620.png","language":"Ruby","readme":"Boxing\n===\n[![Ruby](https://github.com/elct9620/boxing/actions/workflows/main.yml/badge.svg)](https://github.com/elct9620/boxing/actions/workflows/main.yml)\n\nThe zero-configuration Dockerfile generator for Ruby.\n\n\u003e The [Database Repository](https://github.com/elct9620/ruby-boxing-db) will be used for package information.\n\n## Installation\n\nAdd this line to your application's Gemfile development group:\n\n```ruby\ngroup :development do\n  gem 'boxing'\nend\n```\n\nAnd then execute:\n\n    $ bundle install\n\n## Features\n\n### Automatic Package Finder\n\nThis gem will read `Gemfile` and find any \"knows\" gem in the dependency database and put the necessary package as a dependency for build and runtime.\n\nThat means you never need to know the actual package and don't need to write your Dockerfile by hand.\n\n### Optimized Size\n\nBy the default, the base image is depend on `ruby:[VERSION]-alpine` which is minimal size for Ruby in most cases.\n\nTo let your image as small as possible, this gem uses multi-stage and strip useless artifacts while the c-extension compiling.\n\nThe final Rails image will be around 100MB and can be flexible to delivery to any environment.\n\n\u003e We suggest using `puma` as the webserver to avoid the extra dependency to keep the image small.\n\n### Bootsnap Precompile (Experimental)\n\nIf your gem dependency included `bootsnap` the generated Dockerfile will add precompile options to speed up the application bootstrap.\n\n### AWS Lambda Runtime Interface Client\n\nWhen the `aws_lambda_ric` gem is detected, the `boxing` will choose to use `bin/aws_lambda_ric` as entrypoint.\n\nTo make it works correctly, run `bundle binstub aws_lambda_ric` to make it can run it correctly.\n\n### Revision\n\nTo identity your image version, the default build argument `REVISION` will be configured by default.\n\nYou can add extra options when you are building images in your CI.\n\n```yaml\n# GitLab CI example\ndocker:rails:\n  extends: .docker\n  stage: package\n  script:\n    - docker build\n      --cache-from $RAILS_IMAGE:latest\n      --build-arg REVISION=${CI_COMMIT_SHORT_SHA}\n      --build-arg BUILDKIT_INLINE_CACHE=1\n      --tag $RAILS_IMAGE:$CI_COMMIT_REF_SLUG\n      --tag $RAILS_IMAGE:latest .\n```\n\nIt will helpful for Sentry to detect the released version or use `\u003c%= ENV['REVISION'] %\u003e` to help you identify the current version.\n\n## Usage\n\n### Generate\n\nTo generate `Dockerfile` for current project\n\n```ruby\nbundle exec boxing generate\n```\n\n### Update\n\nTo update the database for package information\n\n```ruby\nbundle exec boxing update\n```\n\n\u003e If the generated `Dockerfile` is not satisfy, please try to update it.\n\n## Configuration\n\nIf `config/boxing.rb` is found, it will be loaded and change the generated `Dockerfile` and `.dockerignore`\n\n### Source Code Root\n\n```ruby\nBoxing.config do |c|\n  c.root = '/var/www'\nend\n```\n\n### Customize Entrypoint\n\n```ruby\nBoxing.config do |c|\n  c.entrypoint = ['bin/rails']\nend\n```\n\n### Customize Command\n\n```ruby\nBoxing.config do |c|\n  c.command = ['server', '-b', '127.0.0.1']\nend\n```\n\n### Ignore Files\n\n```ruby\nBoxing.config do |c|\n  c.ignores = %w[\n    vendor/gems\n  ]\nend\n```\n\n### Extra Packages\n\n```ruby\nBoxing.config do |c|\n  c.build_packages = %w[nodejs]\n  c.runtime_packages = %w[git]\nend\n```\n\n### Revision Information\n\n```ruby\nBoxing.config do |c|\n  c.revision = true\nend\n```\n\u003e When building the image, you have to add `--build-arg REVISION=...` to set your revision name to compile it correctly.\n\n### Sentry Support\n\n```ruby\nBoxing.config do |c|\n  c.sentry_release = true\nend\n```\n\u003e When building the image, you have to add `--build-arg SENTRY_RELEASE=...` to set your release name to compile it correctly.\n\n### Assets Precompile\n\nThis feature is disabled by default and suggest to use CI to build it.\n\n```ruby\nBoxing.config do |c|\n  c.assets_precompile = true\n  # If not given the `node -v` will be execute\n  c.node_version = '14.18'\nend\n```\n\u003e When building the image, you have to add `--build-arg RAILS_MASTER_KEY=...` to set your production key to compile it correctly.\n\n### Health Check\n\n```ruby\nBoxing.config do |c|\n  c.health_check = true\n  c.health_check_path = '/api/status.json'\nend\n```\n\n\u003e If `liveness` gem is installed, the health check will enabled by default with `/status` path.\n\n## Roadmap\n\n* [x] `Dockerfile` generator\n* [x] `.dockerignore` generator\n  * [x] Common ignore files\n  * [x] Customizable ignore files\n* [ ] Docker Compose generator\n  * [ ] Production Version\n  * [x] Development Version\n* [x] Allow run Assets Precompile in Container\n  * [ ] Disable `RAILS_SERVE_STATIC_FILES` by default\n* [x] Customize config file `config/boxing.rb`\n  * [x] Customize `APP_ROOT`\n  * [x] Extra packages\n  * [ ] DSL to customize `Dockerfile`\n    * [ ] Build Stage\n    * [x] Entrypoint\n    * [x] Command\n    * [x] Expose Port\n* [x] Health Check\n  * [x] [Liveness](https://github.com/elct9620/openbox) gem detection\n  * [x] Add `curl` for web application\n* [x] Entrypoint Detection\n  * [x] [Openbox](https://github.com/elct9620/openbox) (Suggested)\n  * [x] Ruby on Rails\n  * [x] Rack (Default)\n  * [x] AWS Lambda Runtime Interface Client\n    * [x] Lamby supported (Default)\n    * [x] SQS ActiveJob Lambda Handler\n* [ ] Package Database\n  * [x] Built-in (Move to standalone repoistory in future)\n  * [x] Standalone Repoistory\n  * [x] Support gems from `git` repoistory\n  * [x] Customize Source\n  * [ ] Base Image\n    * [x] Alpine\n    * [ ] Ubuntu\n  * [ ] Filter by Ruby Version\n  * [ ] Filter by Gem Version\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/elct9620/boxing. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/elct9620/boxing/blob/main/CODE_OF_CONDUCT.md).\n\n## Code of Conduct\n\nEveryone interacting in the Boxing project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/elct9620/boxing/blob/main/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felct9620%2Fboxing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felct9620%2Fboxing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felct9620%2Fboxing/lists"}