I'm glad it helped you!
As the final code will be static, the URLs and APIs will be fixed. So the only way is to create different Docker tags with the different fixed URLs, environment etc. And name your image tags like mysuperapp:test, mysuperapp:beta and mysuperapp:prod. And then, you deploy each image to each environment. I normally would have 3 git branches, master for "stag", a branch "production" for production, and let's say a branch "test" for testing. And then, with CI (GitLab CI, TravisCI, Drone) I would make it build the image automatically and tag it depending on the branch, and also deploy it.
Here's a full-stack project generator I have that includes that (you can just check the generated .gitlab-ci.yml file, the docker-compose files and the frontend directory to know how it's done): https://github.com/tiangolo/full-stack