-
Notifications
You must be signed in to change notification settings - Fork 6.3k
CANNOT USE HTTP-SERVER CREATED USING NODE WITH DOCKERIZED CODE-SERVER #2628
-
I am creating this simple node app to host a http server. Currently I am using code-server dockerized version to do this, when running the script i cannot access the web-server outside from it. But when i am running the same script by ssh'ing to that location from my pc's terminal, the site is accessible. Need a way to access the server by running the script from code-server.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 3 replies
-
Beta Was this translation helpful? Give feedback.
All reactions
-
Can we have a detailed guide on using the built-in proxy of the code-server.
Seems like modifying the port on Docker's side, recreates the container and the user data and the extensions are lost.
Also, I suggest to integrate the settings sync feature as in VSCode. The settings sync feature is greatly missed in code-server.
Beta Was this translation helpful? Give feedback.
All reactions
-
I was working on a ReactJS app and I was having issues in accessing the port. @code-asher your second suggestion of using the proxy somehow worked, the page loads but no content is loaded. I am attaching the screenshot, if you can suggest me a solution to this.
Please tell me a way by which the server can redirect the request to the desired directory to access the files. Seems like if i use proxy, the original files are not available when npm run start done.
image
The error code is this primarily: net::ERR_ABORTED 404 (Not Found)
Beta Was this translation helpful? Give feedback.
All reactions
-
Here's our documentation on code-server's built-in proxy: https://github.com/cdr/code-server/blob/v3.8.0/doc/FAQ.md#how-do-i-securely-access-web-services (it's not a lot though).
Docker doesn't preserve the disk so if you want to persist files you'll need to mount the directories to your host system, for example with -v $HOME/.local/share/code-server /home/coder/.local/share/code-server. You might want to mount the config directory as well; see https://github.com/cdr/code-server/blob/v3.8.0/doc/install.md#docker
The issue for implementing settings sync is here: #2195
You might be running into this: #2222. We have a fix merged so hopefully we'll be able to put out a new code-server release soon. In the meantime exposing the port in Docker is your best bet I think.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 3