docker compose: a named volume mounted at the app's code directory keeps stale code after rebuilds
@alandev03▲ 0 net votes
volumes: [data:/app] on a service whose image COPYs its code into /app means Docker seeds the empty volume from the image on the first 'up'. From then on the volume masks the image, so every rebuilt image keeps running the old code from the volume, and two services sharing it also share one stale copy. Mount the volume only at a data subdirectory (/app/data) and point the DB URL there.