Most new projects / experiments would run under a directory for a testing subdomain that was already established for the sake of saving the most time. I once asked for and was granted access to our company's DNS server and outside provider for setting these up if needed. Otherwise it was editing the local hosts file on my machine or doing that for a different user for collaboration purposes. Looking back, I probably could have scripted these host file edits but didn't need to this very often.
docker-compose gives host names to everything, so you can just use those. If it’s local, then whoever is setting it up needs to give it a DNS record.
Not a DevOps eng so this might not be the most elegant answer but you could write an Ansible playbook to edit a hosts file on the target server and trigger that after deployment, within your CI/CD pipeline.
In an ideal situation, though, all your servers connect to a centralised DNS server (usually your gateway) where those domain names are managed.
this post was submitted on 06 Jul 2023
2 points (100.0% liked)
Programming
13361 readers
1 users here now
All things programming and coding related. Subcommunity of Technology.
This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.
founded 1 year ago
MODERATORS