DEV Community

Willem Turkstra
Willem Turkstra

Posted on

1 1

Simple DX improvement in PHPStorm

For the longest time i always started my development environment manually. This meant that I opened my PHPStorm. Opened a terminal and typed in the long command: docker compose -f docker-compose.yml -f docker-compose.development.yml up -d and then opened another terminal to start ngrok: ngrok http [PORT] --region=eu. And then copied the created ngrok url into my env file to set some base url en redirect urls.

I did this every day..., ...manually.

Eventually i created some aliases to start my docker containers and the ngrok tunnel. But it still comprised of multiple clicks and keystrokes to get the environment up and running.

And this morning i was kind of fed up with it. I opened my PHPStorm and started playing around with run configurations.
I quickly added a configuration to start my docker containers. I then needed to start the ngrok tunnel based on a port in my env file, therefor i created a script which fetched the port from my env file and ran my ngrok command.

And now for the last step i needed to replace the urls in my env file with the public_url one from the created ngrok tunnel.

After adding all these steps separately to my IDE i created a compound configuration which combined all these configurations into a single startable configuration.

And there it was a single click to start my development environment!

Sometimes it is worth it to focus on a little bit of DX and improve your workflow.
Also, don't be afraid to explore a topic you secretly dread!

Billboard image

Use Playwright to test. Use Playwright to monitor.

Join Vercel, CrowdStrike, and thousands of other teams that run end-to-end monitors on Checkly's programmable monitoring platform.

Get started now!

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay