DFE-Digital / polis-whitelabel

:milky_way: Open Source AI for large scale open ended feedback
https://pol.is
GNU Affero General Public License v3.0
3 stars 0 forks source link

Rapid development setup with Docker #11

Closed brendanarnold closed 1 year ago

brendanarnold commented 1 year ago

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

patcon commented 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!

brendanarnold commented 1 year ago

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.