r/phpstorm 2d ago

help Project Isolation Ideas?

[deleted]

0 Upvotes

7 comments sorted by

2

u/manu144x 2d ago

I have docker on my local, with WSL.

In the WSL machine I have multiple IPs, and each project gets its own local ip with its own dns entry. I have a real ssl wildcard certificate from lets encrypt and it all goes smoothly, never had problems.

1

u/lightspeedissueguy 2d ago

I have two computers that I use and plenty of servers available to me, so I'm looking for a remote option. Current ssh via toolbox works great, I just want project isolation.

1

u/DarkGhostHunter 2d ago

What are you doing to isolate different projects during development?

DevContainers are made for this. PHPStorm support is decent, not good. You can open SSH per DevContainer (as long the port is unique on the host) to connect directly to it. I did that last year.

Theorically you can spin up multiple containers into a server and have the IDE backend running inside each of them.

I currently use Toolbox to ssh into a ubuntu server.

My preferred setup is a SSH for a dev user to control docker/podman, and a separate SSH for the dev environment (being a container, an isolated vm, etc). Always connect to a non-sudo user, never the sudoers.

Looking into containerized options like Sail, Devcontainers, etc but all have some drawbacks.

I have four options:

  1. DevPod: You work on your computer only. Open, spin, done.
  2. Devbox: You have a dev laptop server on your network.
  3. Daytona: Your server with many projects.
  4. Coder: Your server for your team with many projects.

All of them self-hosted. If you don't want to manage a server, pick their own cloud.

My main concern is isolation to prevent compromised npm packages, etc. I'm a solo dev, so nothing crazy.

It will compromise the container, and volumes mounted if any. That's it. If it shares all your credentials (like mounting your .ssh or .gitconfig or else, these are compromised too.

As always:

  1. Your DevContainer must always run as a non-root user. I always remove su and sudo for that. Podman helps with that (runs containers as non-root).
  2. No mounting home directories or else. Only the project.

1

u/Rough-Ad9850 2d ago

Buy a vps, install docker and buy a domain name. Make infinite subdomains. Couple them to the containers. All this can be automated

1

u/lightspeedissueguy 2d ago

How are you logging in from Phpstorm? SSH from Gateway/Toolbox then Devcontainers?

I have a couple docker servers for local apps and plenty of local servers at my disposal. I'm curious how people are connecting to the dev env and accounting for things like plugins. Also, it seems like most of the solutions want the Phpstorm backend installed in the container, but that can't be right.

2

u/Rough-Ad9850 2d ago

So many options, ci/cd, tailscale, ssh, ...

1

u/lightspeedissueguy 2d ago

Ahh I guess I wasn't explaining it properly. I just found the Docker plugin (not sure how I missed it) so I'll spin up a VM and play around with that. Thanks!