Closed brendanarnold closed 1 year ago
does not use e.g. Docker volumes so a rebuild is required each time
This is actually by design, and is what allows reproducible builds and caching via docker layers. Without this, build time is VERY slow, and container images will just hold the OS environment instead of the app code.
There is probably a way to layer docker-compose config to get the best of both world. But I'm currently on a team where we're building into volumes, and it's actually quite frustrating (partially because it runs slower).
My understanding is that volumes are best for data and databases, but building app code into a docker filesystem layer is the prod-like thing to do. Maybe I'm wrong tho!
We have been using Devcontainers. At the moment they are Debian based which isn't ideal (should be Alpine to match prod configuration) however with this workflow you can edit the source directly on the Container and rebuild/restart the server for a much tighter dev loop - no rebuilding required. It does require VSCode though as support in other IDEs isn't yet implemented.
As a developer I want to be able to setup a rapid development loop in Docker So that I can quickly develop and deploy to a Docker based platform
Technical notes
deploy/docker/docker-compose.dev.yml
for an example of a build and run configurationdocker-compose.dev.yml
does not use e.g. Docker volumes so a rebuild is required each timewatch
commands so commands running in Docker can restart on code change