Detect the port at which the website is running in the bin/start script
The bin/start script is used to spin up the environment. There are two mentions of the website running on port 3020, and one test to see if the website has actually started that also uses that port. It is possible though for a student to change the port mapping in the docker-compose file, which would mean that the mentions and check would be incorrect. We should detect at which port the website runs and update the bin/start script.
Hi!
I've been taking a look to set up the environment locally and this is something I'd like to tackle if no one else is on it yet.
Without having the full context of the project (yet) my first thought is creating an .env file with the port configuration there. WEBSITE_PORT=3020
- docker-compose 1.5+ automatically reads .env files, so we could change the port for
${WEBSITE_PORT}on docker-compose.full.yml - bin/start would need to read the env file, which should be as easy as
set -o allexport; source .env; set +o allexportand then using the env variable to load the port
As far as I've seen those are the 2 places where the port is used / hardcoded. Any other places? anything else I might have missed?
Thanks for everything!
@TJSoler. Thanks for taking this on. @ErikSchierboom is away this week but will get back to you next week :)
Cool, I'm in no rush. I will probably do it anyway because it's a really straightforward thing and I want to tinker with the new site and need to change ports. So what I might do is create my original idea as a pull request and continue the conversation there.
I'm more than open to change strategies once @ErikSchierboom has the time to check it out, or if the PR ends up closed, that's ok too.
Sooo... Maybe I jumped the gun. I still believe it's easy but as far as I can see it would need to be coordinated between exercism/config, exercism/website and this repo.
I am still willing to work on this, but I don't have the context for the whole organisation wide repos / source / architecture. So I will wait for you to have time and have some input before progressing.
This is my work so far: https://github.com/exercism/development-environment/compare/main...TJSoler:define-website-port-in-env-file
It works, but internal links on the website are still hardcoded to the port.
@TJSoler This would indeed also require changes to the website and config repo. We're currently very busy with preparing for the beta, so I think I won't get around to doing this for a while. I'm fine with keeping this open though, as I do think it is a good suggestion.
I agree this is (and should be) low priority. What I think I might do if you agree, I might start working on the changes on website and config repos, maybe even open the PR to track the changes and open discussion, but mark the PR as [WIP], wait for the dust of V3 to settle. I wouldn't want to add anything non-important to your plate.
It's also a really good opportunity for me to see how the repos connect with eachother and to understand the project a bit.
Congrats on an amazing work BTW, really cool what I've seen so far.
@TJSoler Yeah that's totally fine. We probably won't be able to review for a while, but be our guest!