I work on a Rails project, using Webpack to bundle the assets. Each time I make a change in JS or CSS, I run docker-compose exec web bundle exec rake assets:precompile; to compile all the assets.
After that, I have to restart the docker containers, and run the docker-compose exec web bundle exec npm run dev;
Only after that, I can see the change, and it can take up to 10 minutes. What am I missing? How can I speed up my development process?
My docker-compose.yml:
version: '2'
services:
chromedriver:
image: selenium/standalone-chrome-debug
volumes:
# use hosts shared memory to prevent crashes
# https://github.com/SeleniumHQ/docker-selenium
- /dev/shm:/dev/shm
postgres:
image: postgis/postgis:12-3.0
volumes:
- ./bin/docker/postgres/init-test-db.sh:/docker-entrypoint-initdb.d/init-test-db.sh
- .:/project
logging:
driver: "json-file"
options:
max-size: "10k"
max-file: "1"
redis:
image: redis:5.0.5
logging:
driver: "json-file"
options:
max-size: "10k"
max-file: "1"
worker:
build: .
volumes:
- .:/usr/src/app
- bundle-cache:/usr/local/bundle
command: bundle exec sidekiq
logging:
driver: "json-file"
options:
max-size: "100k"
max-file: "1"
web:
tty: true
stdin_open: true
build: .
volumes:
- .:/usr/src/app
- bundle-cache:/usr/local/bundle
logging:
driver: "json-file"
options:
max-size: "10k"
max-file: "1"
volumes:
bundle-cache: