To refresh the build image, you need to add
--build to the docker-compose command.
--build flag tells docker to compile any Dockerfiles before starting running the compose
docker-compose up --build
Not using the flag aka not refreshing the build image and then making changes is quite a common trap to fall into. This can when starting out with docker-compose!