DEV Community

Tingwei
Tingwei

Posted on • Updated on

Connect to Docker Containers with GoTTY

What I did

I would like to put my game in Python on my website. There're so many ways to implement my idea. Finally, I decided to use GoTTY to connect to my Docker container.

Enter the container

docker exec -it [container id] sh
Enter fullscreen mode Exit fullscreen mode

In the container, I executed the command like this

gotty -w -p 9998 python [your_script] 
Enter fullscreen mode Exit fullscreen mode

How it looks like

Image description

I used Caddy as my web server !!

Reference

GoTTY: Share your terminal as a web application
Caddy

Top comments (0)