Lesson 7: Testing with Docker: An Elven Fortress
[CFL2M] Don’t Make This Server Mistake
*Note: This content is from our free ColdFusion Legacy 2 Modernization E-Course [CFL2M]. To learn more about the E-course, click here.
You need a test server separate from your production server. Do you have them in physically different places?
Segregating your servers makes your production app more reliable. You’ll avoid the risk of testing using up all the server resources, which can leave your users suffering from weird memory bugs and crashes.
Before I go on, I just want to make sure you read the last email and downloaded the CF source control tools I recommended. If so, great job! If not, please do it 🙂
Now, a dedicated CF test server helps to:
- Catch bugs early
- Ensure your app performs under pressure
- Safeguard your live environment from potential threats
- Keep out dreadful developers that don’t like Lord of The Rings
But did you know that you don’t need to use the same hosting company or level of hosting “horsepower” as your live server?
A separate container test environment lets you simulate real-world usage for a day or two, without the expense of mirroring your live server's "horsepower." This approach allows for rigorous stress and security testing, ensuring your app stays robust and reliable.
A robust testing environment and workflow looks like this:
Development Server → Test (QA) Server → Production Server
When you’re ready to push things from the dev. to the test server, you do an integration test. Once it passes the QA server, only then does it get pushed to production.
- [Also, the test server is supposed to be a mirror copy of the Production server. Same CF admin settings, ideally same RAM and CPU and network.]
If you don't have a test server up, a quick and cheap way to spin one up is to use Docker and CommandBox. You’ll be able to clone servers faster than it takes a hobbit to finish a pint of beer.
Don't skip on good configuration.
Using Docker with CommandBox is a great way to configure a consistent, portable test environment. You can get one cloned from your dev container in minutes.
Note: Testbox is great for automating testing; we’ll explore that in detail in a later email.
Aragorn Action Step: If you don't have a test server, spin one up using Docker and CommandBox.
If you already have a test server, then give yourself a pat on the back 🙂, then go make sure that it’s configured exactly the same as production.
You’re halfway through this ColdFusion E-course. Congratulations and keep up the good work!
The next email is going to summarize everything we’ve learned thus far and help you make better sense of it, so be on the lookout!
Happy testing!
Michaela Light, CEO TeraTech
PS If you have any questions about your legacy CF app or find yourself thinking “How serious is this? What can we do about it?” you may qualify for a free CF assessment.
After a thirty-minute screen share call, you’ll walk away with a scorecard summary with bespoke solutions. Sign up here for a free assessment. It’ll take less than 2 minutes to sign up.