DEV Community

Willem Turkstra
Willem Turkstra

Posted on

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!

Top comments (0)