{"id":15552241,"url":"https://github.com/bahmutov/tiny-blog","last_synced_at":"2025-09-26T11:30:58.935Z","repository":{"id":37030426,"uuid":"142302868","full_name":"bahmutov/tiny-blog","owner":"bahmutov","description":"Example static blog","archived":false,"fork":false,"pushed_at":"2025-01-14T12:45:56.000Z","size":773,"stargazers_count":8,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T13:53:37.311Z","etag":null,"topics":["docker","docker-image","example","multi-stage"],"latest_commit_sha":null,"homepage":"tiny-blog.bahmutov.vercel.app","language":"Dockerfile","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/bahmutov.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-25T13:21:02.000Z","updated_at":"2022-02-14T13:44:20.000Z","dependencies_parsed_at":"2024-02-22T23:31:44.361Z","dependency_job_id":"d2560f35-efe2-42e4-80c1-5b38fa65c7e2","html_url":"https://github.com/bahmutov/tiny-blog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftiny-blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftiny-blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftiny-blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftiny-blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bahmutov","download_url":"https://codeload.github.com/bahmutov/tiny-blog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234305162,"owners_count":18811307,"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","docker-image","example","multi-stage"],"created_at":"2024-10-02T14:13:19.048Z","updated_at":"2025-09-26T11:30:53.624Z","avatar_url":"https://github.com/bahmutov.png","language":"Dockerfile","readme":"# tiny-blog [![renovate-app badge][renovate-badge]][renovate-app]\n\n\u003e Shows how to use multi-stage Docker build with Cypress tests\n\nSee [Dockerfile](Dockerfile) for detailed comments.\n\nAlso shows how [Zeit.co GitHub integration](https://zeit.co/blog/now-for-github) tests and deploys each commit. See [example PR](https://github.com/bahmutov/tiny-blog/pull/2)\n\n## GitHub PR\n\nEach PR gets a check from Zeit. Click on \"Details\" to see the verbose build output\n\n![Click on \"details\" for PR](images/github-details.png)\n\n![Build output](images/zeit-installing.png)\n\nOnce the build finishes, you will be redirected to the deployed site. If you do not want to redirect to the deployed site, but would like to see the build text (including test results), copy the url, remove `redirect=1` parameter and open in your browser.\n\nExample output (I have removed timestamps)\n\n```text\n====================================================================================================\n  (Run Finished)\n      Spec                                                Tests  Passing  Failing  Pending  Skipped\n  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐\n  │ ✔ spec.js                                   00:01        1        1        -        -        - │\n  └────────────────────────────────────────────────────────────────────────────────────────────────┘\n    All specs passed!                           00:01        1        1        -        -        -\n?25h\nINFO: Gracefully shutting down. Please wait...\n ---\u003e 0c1b55220b03\nRemoving intermediate container 7aea2986b90e\nStep 13/16 : FROM busybox as PROD\n ---\u003e e1ddd7948a1c\nStep 14/16 : COPY --from=TEST /app/public /public\n ---\u003e e0c2947a7de8\nStep 15/16 : RUN ls -la\n ---\u003e Running in 87fa2de2de26\ntotal 92\ndrwxr-xr-x    1 root     root          4096 Aug  4 10:17 .\ndrwxr-xr-x    1 root     root          4096 Aug  4 10:17 ..\n-rwxr-xr-x    1 root     root             0 Aug  4 10:17 .dockerenv\ndrwxr-xr-x    2 root     root         12288 Jul 31 20:20 bin\ndrwxr-xr-x    5 root     root           340 Aug  4 10:17 dev\ndrwxr-xr-x    1 root     root          4096 Aug  4 10:17 etc\ndrwxr-xr-x    2 nobody   nogroup       4096 Jul 31 20:20 home\ndr-xr-xr-x  124 root     root             0 Aug  4 10:17 proc\ndrwxr-xr-x    2 root     root          4096 Aug  4 10:17 public\ndrwx------    2 root     root          4096 Jul 31 20:20 root\ndr-xr-xr-x   13 root     root             0 Jun 25 16:06 sys\ndrwxrwxrwt    2 root     root          4096 Jul 31 20:20 tmp\ndrwxr-xr-x    3 root     root          4096 Jul 31 20:20 usr\ndrwxr-xr-x    4 root     root          4096 Jul 31 20:20 var\n ---\u003e 54e272eac08c\nRemoving intermediate container 87fa2de2de26\nStep 16/16 : RUN du -sh\n ---\u003e Running in 66cde2b94418\n1.3M\t.\n ---\u003e 522c3cd19f9b\nRemoving intermediate container 66cde2b94418\n[Warning] One or more build-args [NOW_REGION NOW_URL HOSTNAME NOW NOW_DC] were not consumed\nSuccessfully built 522c3cd19f9b\nSuccessfully tagged registry.now.systems/now/bd09651bd838b85d4a0c235c5ff29094217d3d75:latest\nexit code: 0\nUploading static files (16.0K)\nexit code: 0\n```\n\n## Cache busting\n\nLocally, rerunning `docker build .` will NOT run all commands, since every command stays the same, and Docker does not rerun commands unless the contents changes. So it _always_ rerun `npm test` command you have to *bust cache*. I have defined a build argument `HOSTNAME` and you can pass new value to guarantee that `npm test` runs.\n\n```text\ndocker build . --build-arg HOSTNAME=foo\n```\n\nI suggest using timestamp as the argument value\n\n```text\ndocker build . --build-arg HOSTNAME=$(date +%s)\n```\n\n## Related information\n\n- [Making Small Docker Image](https://glebbahmutov.com/blog/making-small-docker-image/)\n\n[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg\n[renovate-app]: https://renovateapp.com/","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Ftiny-blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahmutov%2Ftiny-blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Ftiny-blog/lists"}