Docker project progressing, deploying, CORS, user accounts next.
Dreamt about the project last night, I was explaining to my coworker how I can run docker commands on the host from a docker container on that host. Needless to say I'm excited to start the day.
Yesterday, after submitting the diary entry, I actually did a little more work because I was so eager to finish, so I'm updating the entry now.
I had to tweak my nginx config a bit to fix the Host header rewriting and allow gzip, and now it seems to be working well.
The issue I have now is that the cleanup doesn't get triggered when I stop the container. Does the go program not receive sigterm when I stop the host container? I will have to look into that.
I've resolved the cleanup issue for now, but I foresee issues in the future. I will get back to this once I implement cleaning up of stale containers.
Before deploying, I have to keep in mind the additional params I had to add to my run docker config. I had to set up the network (creating it should probably also be automated, just in case) and the volume binding for the docker socket
I figured out that if I add /?folder=/tmp/codeinteractive/testing-in-dotnet into the url, the folder will open automatically. This solves some of my issues. I still need to figure out how to make it trust the folder automatically. Probably some config file that I can inject?
Time to test with the UI
I've set everything up, but I'm getting a CORS error and have no idea how that's possible.
It was actually a proxy error resulting in 404, but the browser console error confused me. Anyways, I can load the site use it normally.
Now, I need to set up so that the container is started when a user opens the page, and a nice loading screen is displayed while they wait for it to start.
Now, I need to deploy it to production to make sure the subdomain routing works. To do that, I need to make the nginx config load the domain from env variables
I've set the env var loading using envsubst inside the docker entrypoint script. Good enough. I've put solid 5 hours in, time for a break. In the evening, I will try deploying it to production. If all goes well, I will move onto user accounts.
I managed to deploy it and configure the DNS for it to work. The starting is somehow problematic, unless I go with a hacky way of using localhost as subdomain. I'm going to be changing the starting soon so I'm not going to invest time into that right now, just wanted to verify if the subdomain thing will work.
I will probably need to separate the orchestrator from the nginx because of the SSL.
Time to set up user accounts!
I ended up researching all the different auth options again and considered Next Auth for some time, but decided Supabase is the best choice as I still want to support users and passwords. I ran out of time though, as it's getting pretty late, but I'm generally happy with the progress today.