Skip to content

How to run projects, #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
triDcontrols opened this issue Apr 20, 2019 · 7 comments
Closed

How to run projects, #555

triDcontrols opened this issue Apr 20, 2019 · 7 comments

Comments

@triDcontrols
Copy link

triDcontrols commented Apr 20, 2019

This may be the easiest question, but I cannot figure this out. How do I run projects? Installation went great, I have it in a Docker w/ Nginx reverse proxy.

I mean I write a HTML and Js, import CSS from CDN etc and how do I get my project to run in a browser. I cannot find the docs.

Will the project path be the url path? When I try this, I get a 404.
https://code.mydomain.com/project/demo/demo.html

@Egoscio-zz
Copy link

You could mount a directory on your host filesystem to /home/coder/project as a volume, then have an Nginx static file server that serves that directory. Here's the nginx documentation for serving static files, and docker documentation for volumes.

@triDcontrols
Copy link
Author

Bummer, I was hoping this was an all in one solution. Would've been nice to map a port # to a URL path of the project and watch it live in chrome. hmm. Guess I'll continue using my VScode desktop app on my laptop.

@ntindle
Copy link

ntindle commented Apr 21, 2019

I think this is very possible. I’m doing it right now with Apache. Just setup Nginx to point to that folder and to map ide.domain.com to coder.

In coder’s container, make sure you mount that directory and it should just work

@niv-d
Copy link

niv-d commented Apr 21, 2019

@triDcontrols
There's a couple ways to do what you want, are you talking just preveiwing the files as you work on it, or uploading to the actual site you're working on, or hosting your own website?

The first option, previewing: There's an extenstion called "Live HTML Previewer" that allows the previewing of html as you work on it, and it works with coder.

If the second options: Try the SFTP plugin, with some configuration (Really easy config) it will upload to your webserver via ftp or sftp, thus allowing you to simply refresh the page.

The last one: Coder is meant to vscode, not a webserver, just as your desktop doesn't allow a webserver to be run, nor does coder. Atleast not by default. Search for this plugin: "Preview on Web Server", it might be what you want.

@infogulch
Copy link

@dmratcliffe this seems related to another comment I made which basically states that if we had a known/fixed list of http paths that are used by coder, that would allow us to route an unused uri path to the application. So the coder ide is at ide.mydomain.com/ except requests to, say, ide.mydomain.com/web which are routed to port 8080 on the container which you can serve with your app.

@code-asher
Copy link
Member

I'm closing this as it seems the question was answered but let me know if anything is still unclear.

@code-asher
Copy link
Member

code-asher commented Sep 17, 2019

I do think it would be interesting to have a way built into code-server to proxy/tunnel to services and files running on the remote server/Docker. Tracking for that is here: #512.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants