{"id":21612247,"url":"https://github.com/anapsix/worker-in-a-box","last_synced_at":"2026-01-04T21:04:02.060Z","repository":{"id":42915880,"uuid":"248832472","full_name":"anapsix/worker-in-a-box","owner":"anapsix","description":"Cloudflare Workers with Cloudworker and Nginx Unit","archived":false,"fork":false,"pushed_at":"2024-04-04T22:05:45.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-24T20:18:23.576Z","etag":null,"topics":["cloudflare-workers","nginx-unit"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anapsix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-20T19:06:38.000Z","updated_at":"2024-04-04T22:01:07.000Z","dependencies_parsed_at":"2024-04-04T23:23:13.183Z","dependency_job_id":"ef06b91c-fd93-40a1-b21f-4c0b6c2b233c","html_url":"https://github.com/anapsix/worker-in-a-box","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/anapsix%2Fworker-in-a-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anapsix%2Fworker-in-a-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anapsix%2Fworker-in-a-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anapsix%2Fworker-in-a-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anapsix","download_url":"https://codeload.github.com/anapsix/worker-in-a-box/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244258487,"owners_count":20424397,"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":["cloudflare-workers","nginx-unit"],"created_at":"2024-11-24T21:17:36.884Z","updated_at":"2026-01-04T21:03:57.026Z","avatar_url":"https://github.com/anapsix.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# worker-in-a-box\n\nNOTE: please see Cloudflare's official [`workerd`][cf-workerd] for running\nCloudflare Workers in local dev environment.\n\n[Cloudflare Workers][cf-workers] are awesome! But what if you want to run\nworkers in your dev environment, or in your own environment? Well, there is\na great project (albeit, unmaintained) from Dollar Shave Club - [cloudworker],\nwhich allows you to run Cloudflare Workers locally. Let's combine it with\n[Nginx Unit][nginx-unit], and run it in a Docker container.\n\nUsing an image built based on this repo as source in `FROM` directive, one can\ncreate a functional worker-in-a-box.\n\n\n## Usage\n\n1. Initialize submodule\n```bash\ngit submodule init\ngit submodule update\n```\n\n2. Build worker-in-a-box image\n```bash\ndocker build -t worker .\n```\n\n3. Use the image to package your Cloudflare Worker (see [hello-world] example)\n```Dockerfile\n# Dockerfile\nFROM worker\n```\n```bash\ndocker build -t hello-world .\n```\n\n4. Launch it\n```bash\ndocker run -it --rm -p 8080:8080 hello-world\n```\n\n5. Access it via http://localhost:8080\n\n\n## TODO\n- patch [cloudworker] to support Redis as KV\n- improve `lauch_worker.js` script to work with KV bindings\n- improve ONBUILD process\n\n[link reference]::\n[cf-workerd]: https://github.com/cloudflare/workerd \n[cf-workers]: https://workers.cloudflare.com/\n[cloudworker]: https://github.com/dollarshaveclub/cloudworker\n[nginx-unit]: https://unit.nginx.org/\n[hello-world]: ./examples/hello-world\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanapsix%2Fworker-in-a-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanapsix%2Fworker-in-a-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanapsix%2Fworker-in-a-box/lists"}