Hey @tourist-C
Heroku exposes the available port with the PORT environment variable so you need to use this in your Dockerfile,
CMD ["sh", "-c", "streamlit run --server.port $PORT path_to_your_main.py"]
And you can add this in your docker-compose so that you wont have to change it at the time of deployment,
environment:
- PORT=8000
Hope it helps !
Also this might help, Deploying Streamlit Apps with Docker on Heroku