Skip to content

Add ENV PORT handling #527

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
domesticmouse opened this issue Apr 18, 2019 · 3 comments
Closed

Add ENV PORT handling #527

domesticmouse opened this issue Apr 18, 2019 · 3 comments
Labels
enhancement Some improvement that isn't a feature

Comments

@domesticmouse
Copy link

domesticmouse commented Apr 18, 2019

I'm looking at whether I can run this atop Google Cloud Run, AKA Knative, which is a way of running serverless style Docker images inside of Kubernetes Engine.

My first requirement is to honor a PORT environment variable which defines where we should bind. Can I get some direction on what I need to patch to make that happen? Thanks!

@domesticmouse domesticmouse added the enhancement Some improvement that isn't a feature label Apr 18, 2019
@lucacasonato
Copy link
Contributor

The PORT env var was added in release 1.854-vsc1.33.1 (https://github.com/codercom/code-server/releases/tag/1.854-vsc1.33.1).

To make this work well on GCR you will have to do some work. If you run the container the way it is now you will lose all of your config, extensions and work every so often because Google scales down to 0 instances when you are not using the container. Because GCR expects a container to be stateless you will get a fresh instance with none of your previous work. To make this work you would have to make your container persist state, so for example connect your container to a Cloud Storage instance to make it persist data there. AFAIK Google does not have support for that natively in Cloud Run. I am interested in this too and will do some research. If I find anything interesting ill make sure to post it in this issue.

@lucacasonato
Copy link
Contributor

lucacasonato commented Apr 18, 2019

Duplicate of #502. Maybe rename to "Run code-server on Knative (Google Cloud Run)"

@domesticmouse
Copy link
Author

Thank you for the clarification. I’d love some documentation on how this is built so we can adapt it for using atop GKE. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Development

No branches or pull requests

2 participants