I use GitPod and JetBrains Gateway to develop my application. I run an application in a docker container inside GitPod-container. The container with application expose ports to handle HTTP requests. Is it possible to forward this port to port in my local machine using JetBrains Gateway?
Did you consider the following approach?
Assuming a docker container exposing 8080, in .gitpod.yml
you would have something like:
tasks:
- name: docker
openMode: split-left
command: docker build -t hello-world . && docker run -p 8080:80 hello-world
.gitpod.yml
:ports:
- port: 8080
onOpen: open-browser
visibility: public
gp url 8080
You will be presented with the remote URL for the workspace, exposing the port 8080. The URL will look like: https://8080-****.ws-eu44xl.gitpod.io
.
FYI, there is also an option to Connect via SSH to the workspace, if you find that useful. You find the SSH connection snippet, in the "More Actions" button in the workspace running-status page or when you explore the list of active workspaces (click on the three dots).
If it helps, I've created a sample repo to test this: https://github.com/andreafalzetti/gitpod-experiments-c
If you want to port-forward and open http://localhost:{PORT}
locally, I think that is currently not supported by JetBrains Gateway.