Foreman seems to be the culprit. I was facing a similar issue and I managed to solve it by creating new services in the docker-compose file for each service described in the Procfile.
Before:
web:
build: .
entrypoint: ./entrypoint-dev.sh
command: bash -c "bundle exec foreman start -f Procfile.dev -p 3000"
tty: true
volumes:
- .:/usr/src/app
- bundle:/usr/local/bundle
ports:
- 3000:3000
environment:
- RAILS_MAX_THREADS=5
- RAILS_ENV=development
- RACK_ENV=development
- DATABASE_HOST=db
- DATABASE_USER=postgres
- DATABASE_PASSWORD=password
depends_on:
- db
- redis
After:
js:
build:
context: "."
tty: true
command: "yarn build --watch"
volumes:
- .:/usr/src/app
css:
build:
context: "."
tty: true
command: "yarn build:css --watch"
volumes:
- .:/usr/src/lazy-joker
web:
build: .
entrypoint: ./entrypoint-dev.sh
command: bash -c "bundle exec rails s -p 3000 -b '0.0.0.0'"
stdin_open: true
tty: true
volumes:
- .:/usr/src/app
- bundle:/usr/local/bundle
ports:
- 3000:3000
environment:
- RAILS_MAX_THREADS=5
- RAILS_ENV=development
- RACK_ENV=development
- DATABASE_HOST=db
- DATABASE_USER=postgres
- DATABASE_PASSWORD=password
depends_on:
- db
- redis
- js
- css
You need to attach your terminal to the docker container in order to debug:
docker attach container_id
PS: You can get the container id by running docker container ls
.