So, Docker people that _do_ develop with the Rails app in a container: how do you manage syncing/reloading the app after the filesystem changes?

9
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
/@_web_@toot.cafe

@nateberkopec Volumes for each interesting folder (app, config, etc)

0
3mo
Sebastian Cohnen

@nateberkopec since we use @orbstack volume mounts are a non-issue. With Docker for Desktop there are a ton of tweaks necessary to make it suck less.

0
3mo
Cameron Dutro

@nateberkopec this was the biggest problem for us at Lumos Labs. Regular volumes were way too slow, so we switched to NFS volumes, which worked better. But yeah, the whole thing kinda sucked.

Codespaces FTW

0
3mo
Jeff McFadden

@nateberkopec

volumes:
- .:/app:cached

And it's obnoxiously slow on MacOS. (Better than it was a couple years ago, though)

0
3mo
Dave Copeland :ruby:

@nateberkopec I create a bind mount to my local disk of the entire git checkout. This works well. On macOS, this can be slower than direct disk access but it's gotten faster and it doesn't bother me, especially with the simplicity of the setup (I have also had success with NFS mounts).

In both cases, all tools for auto-doing-stuff must support filesystem polling. Most seem to?

0
3mo
Leonardo Xavier de Brito

@nateberkopec I bind to my local disk, but I'm on Linux, MacOs sucks with docker. I think the Mac users here are using remote virtual boxes with Linux to overcome this.

0
3mo
Seth A. Roby

@nateberkopec I'll also chime in to say that OrbStack has made this pretty much a non-issue (on my M3); I just mount the folder and it works.

0
3mo
Albert Llop

@nateberkopec we use tilt.dev with docker-compose (instead of k8s). No need for bind mounts, but has its quirks.

0
3mo
Oinak :ruby:

@nateberkopec
```yaml
volumes:
- .:/app:cached
- bundle_cache:/bundle
```
on the 'app' service, works for us

0
3mo
Replies