If I’m already running 'wrangler dev'
If I’m already running 'wrangler dev' inside of docker (we have a monorepo where each worker in a monorepo runs in its own docker container), is there any chance this workflow would be supported for workers using cloudflare containers?
5 Replies
nvm apparently possible to run docker inside docker 😅 - would be interested to know more about your workflow , and any particular reason you've got wrangler dev running in docker?
We have a bit of a unique dev environment 😅.
We have a pnpm nx monorepo where we have many different workers, each one running wrangler dev in a container. A single docker compose brings them all up.
We even managed to get service bindings to work in spite of container isolation by using the file system registry with a shared volume mount and merging the local networks between containers. With this setup, we are able to co-locate related containers like ngrok that’s useful for local development.
Oh, to elaborate, this docker setup is only for the development workflow. When we deploy, that’s just 'wrangler deploy' from each worker app. So we don’t have any containers in the production stack, just for dev.
But we sure would like to benefit from the new containers beta if it’s compatible with our dev workflow
I might give it a try with mounting the docker socket into the container or using dind..
👀 pretty cool set up with the service bindings! keen to see how that goes for you.
also not sure if you've seen, but wrangler dev can run multiple workers in one command now, so that sort of gives you the docker compose side of things - doesn't get you the related containers though. if it doesn't work currently, feel free to file a feature request in workers-sdk :)
Yes, I have seen this! It is tempting to check it out. We have a few things that are not on cloudflare (long-running golang servers), so having a docker setup unifies it, but perhaps with the containers beta we can simplify this
Thanks for your responses!
It would be easier for us, especially with regard to the migration to workers, if docker compose files were supported natively. is that planned? That would actually be the most important feature for us, especially at the beginning.