I'm working a large legacy application and we recently updated to Rails 4.2 from 3.2. After the switch, Rails, inside the docker container, isn't picking up changes made from outside the container. Restarting the docker container then picks up the changes. It is getting tiresome to restart docker every time I make a change. I've searched everywhere and found many instances of this issue, with possible solutions but nothing has worked. Touching a file from within a docker bash shell does trigger Rails to reload. File events are not being passed through to the docker container.
Some of the failed efforts:
- adding
config.file_watcher = ActiveSupport::FileUpdateChecker
- updating Docker for Mac to current version
3.1.0
We have devs on both Catalina and Big Sur and both experience the same issue.
docker-compose.yml
worker: &base
build: .
image: myapp/app4
command: bash -c "source /root/.profile && dockerize -wait tcp://mysql:3306 -wait tcp://redis:6379 -timeout 60s rake jobs:work"
env_file:
- ./config/envvars/mysql.env
- ./config/envvars/ruby.env
- ./config/envvars/private.env
volumes:
- "nfsmount4:/usr/src/app"
- ./config/mysql_client.cnf:/etc/my.cnf
- $HOME/.ssh:/root/.ssh
links:
- mysql
- redis
volumes:
mysql-data4:
nfsmount4:
driver: local
driver_opts:
type: nfs
o: addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3
device: ":/System/Volumes/Data/${PWD}"