Possible to expose containers serial port?

If I make a virtual com port with socat in a linux docker container, is there a way to expose that to my Windows host? Such that anything like Putty or Realterm could connect to it?

In our development environment, I’d like to emulate my serial communication. I built an Electron app to run in Windows to generate sample serial data, and would like to connect it to a com port in the docker container. I’m deving in a VScode dev container, but production is an embedded linux board with dedicated COM ports.

Right now I’m doing this with two serial USB adapters, and using usbipd to pass one to my Linux container. My issue with this is:

  1. It requires hardware.
  2. I have to modify the docker compose to remove the device if I want to boot the container without a serial device attached. This is annoying because the docker-compose.yml is checked into git, so I have to be careful to not check it in.
  3. Requires usbipd which seems to be finicky atm