{"id":30127657,"url":"https://github.com/moeki0/docker-best-practices","last_synced_at":"2026-04-11T03:31:34.366Z","repository":{"id":61917163,"uuid":"556260201","full_name":"moeki0/docker-best-practices","owner":"moeki0","description":"Docker best practices for good caching","archived":false,"fork":false,"pushed_at":"2022-10-24T04:04:21.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-30T03:50:22.643Z","etag":null,"topics":["best-practices","docker","docker-compose","nodejs","rails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moeki0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-23T12:52:10.000Z","updated_at":"2023-02-01T08:11:16.000Z","dependencies_parsed_at":"2023-01-20T12:00:48.533Z","dependency_job_id":null,"html_url":"https://github.com/moeki0/docker-best-practices","commit_stats":null,"previous_names":["kawakamimoeki/docker-best-practices","kawakamidev/docker-best-practices","moekiorg/docker-best-practices"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/moeki0/docker-best-practices","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeki0%2Fdocker-best-practices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeki0%2Fdocker-best-practices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeki0%2Fdocker-best-practices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeki0%2Fdocker-best-practices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moeki0","download_url":"https://codeload.github.com/moeki0/docker-best-practices/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeki0%2Fdocker-best-practices/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31668046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["best-practices","docker","docker-compose","nodejs","rails"],"created_at":"2025-08-10T17:08:57.336Z","updated_at":"2026-04-11T03:31:34.347Z","avatar_url":"https://github.com/moeki0.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Best Practices\n\n```\nbrew install colima\n```\n\n```\nbin/prepare\n```\n\n```\nbin/inspect Dockerfile.[variant]\n```\n\n```\nbin/clean\n```\n\n### Variants\n#### 👎 `Dockerfile.single-stage`\n\n- `yarn install` and `bundle install` run in **serial**\n- If any of the sources are changed, the installation is performed always.\n```bash\n=\u003e [app  7/10] COPY . .\n=\u003e [app  8/10] RUN bundle install\n=\u003e [app  9/10] RUN yarn install\n=\u003e [app 10/10] RUN RAILS_ENV=production bundle exec rails assets:precompile  \n ```\n\n#### 👎 `Dockerfile.separate-builder`\n\n- `yarn install` and `bundle install` run in **serial**\n- If `Gemfile.lock` is changed, `yarn install` is performed always.\n```bash\n=\u003e [builder  6/15] COPY Gemfile Gemfile.lock ./\n=\u003e [builder  7/15] RUN bundle install\n=\u003e [builder  8/15] COPY package.json yarn.lock ./\n=\u003e [builder  9/15] RUN yarn install\n```\n\n#### 👍 `Dockerfile.separate-processes`\n\n- `yarn install` and `bundle install` run in **parallel**\n- If `package.json` is changed, `bundle install` will not be executed.\n\n```bash\n=\u003e [yarn 3/4] COPY package.json yarn.lock ./\n=\u003e [yarn 4/4] RUN yarn install                    \n=\u003e CACHED [bundler 1/4] WORKDIR /tmp                         \n=\u003e CACHED [bundler 2/4] RUN gem install bundler              \n=\u003e CACHED [bundler 3/4] COPY Gemfile Gemfile.lock ./         \n=\u003e CACHED [bundler 4/4] RUN bundle install                                   \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoeki0%2Fdocker-best-practices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoeki0%2Fdocker-best-practices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoeki0%2Fdocker-best-practices/lists"}