-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomers
Description
Summary
Setting up a local development environment for a Cloudflare Workers project can be confusing for new contributors. A Docker Compose setup would provide a one-command development environment, lowering the barrier to contribution significantly.
Problem
New contributors need to:
- Install Node.js with the correct version
- Install and configure Wrangler
- Set up local D1 databases and KV namespaces
- Understand the Cloudflare Workers local dev workflow
This is a lot of steps, and any one of them can go wrong. A Docker Compose setup would eliminate most of these friction points.
Expected Behavior / Deliverable
- A
docker-compose.yml(orcompose.yml) file at the project root. - A
Dockerfile.devfor the development environment. - Running
docker compose upshould:- Install all dependencies
- Start the Wrangler dev server with local D1/KV emulation
- Expose the app on a predictable port (e.g.,
localhost:8787) - Support hot-reload when source files change (volume mount)
- A
CONTRIBUTING.mdor updatedREADME.mdsection documenting:- Prerequisites (Docker + Docker Compose)
- How to start the dev environment
- How to run tests inside the container
- Common troubleshooting tips
Implementation Hints
- Project root contains
package.jsonandwrangler.toml(orwrangler.jsonc) — these define the Worker configuration. - Wrangler supports local development via
wrangler dev --localwhich emulates D1/KV/R2 locally using Miniflare. - The Dockerfile should be based on a Node.js image and run
npm install+npx wrangler dev. - Use volume mounts for
src/so changes are reflected without rebuilding. - Environment variables can be passed via
docker-compose.ymlor a.env.examplefile.
Acceptance Criteria
-
docker-compose.ymlandDockerfile.devadded to project root -
docker compose upstarts a working dev environment - Hot-reload works for source file changes
- Documentation added (CONTRIBUTING.md or README section)
-
.env.examplefile with required environment variables documented
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomers