In the docker-compose.yml add to volumes: the file you want to change
volumes:
- ./filetodebug:/internal/full/path/filetodebug
Create a copy of filetodebug in the same directory as the docker-compose.yml and do the changes there.
Then to test, just
docker-compose down
docker-compose up -d