Skip to content

Most stable server OS for running code-server in a vps? #169

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
zanhk opened this issue Mar 9, 2019 · 10 comments
Closed

Most stable server OS for running code-server in a vps? #169

zanhk opened this issue Mar 9, 2019 · 10 comments

Comments

@zanhk
Copy link

zanhk commented Mar 9, 2019

And how to keep it working in background,
it have problem with screen #67 and I haven't try in others way yet.
Running in Debian without screen return the error #121 even if the server keep working.
In general I also notice a global slowdowns in loading files and folders.

@NGTmeaty
Copy link
Contributor

NGTmeaty commented Mar 9, 2019

I believe we are recommending Ubuntu 16.04 at the moment or I believe our Docker config.

@mko-x
Copy link

mko-x commented Mar 9, 2019

I run pretty stable with this configuration:

version: '3.7'
services:
    nginx-proxy:
        #image: jwilder/nginx-proxy:alpine replaced by extended Dockerfile
        build: .
        container_name: proxy
        image: mkox/nginx-proxy
        ports:
        - "80:80" #http redirect
        - "443:443" #https
        volumes:
        - /var/run/docker.sock:/tmp/docker.sock:ro # listening to docker events
        - /etc/certs:/etc/nginx/certs # host place for ssl certs
        environment:
            DEFAULT_HOST: domain.tld
        networks:
            - outpost_network

    codeserver:
        image: codercom/code-server
        container_name: code
        volumes:
            # for scaling (swarm/stack) instances can share same workspace
            # depending on fs type/emu
            - /opt/docker/codeserver/projects:/opt/projects
            - /opt/docker/codeserver/data:/data
        environment:
            # nginx-proxy will autodetect
            VIRTUAL_HOST: code.domain.tld
            # code-server defaults to 8443
            VIRTUAL_PORT: 8443
        # start code-server
        # https is handled by proxy so http is ok 
        # set a pw (!)
        # ARG: desired project workspace
        command: code-server --allow-http --password=code-server-rocks /opt/projects
        # code-server --help
        # ARGUMENTS
        #     WORKDIR  [default: (directory to binary)] Specify working dir

        # OPTIONS
        #     -d, --data-dir=data-dir
        #     -h, --host=host          [default: 0.0.0.0]
        #     -o, --open               Open in browser on startup
        #     -p, --port=port          [default: 8443] Port to bind on
        #     -v, --version            show CLI version
        #     --allow-http
        #     --cert=cert
        #     --cert-key=cert-key
        #     --help                   show CLI help
        #     --no-auth
        #     --password=password
        networks:
            outpost_network:

networks:
    outpost_network:
      driver: bridge
      name: outpost_network

My custom nginx-proxy Dockerfile

FROM jwilder/nginx-proxy:alpine
LABEL maintainer="m-ko"
RUN apk add --no-cache nano logrotate
COPY ./nginxlog.conf /etc/logrotate.d/nginx
RUN { \
      echo 'server_tokens off;'; \
      echo 'client_max_body_size 200m;'; \
    } > /etc/nginx/conf.d/override_proxy.conf

@sr229
Copy link
Contributor

sr229 commented Mar 10, 2019

@ZK-G Here's what I recommend based on my stacks:

  • Container-Optimized OS/CoreOS : If you're running the Docker containers. This is for you if you want a more stateful environment.

  • Fedora 29 : If you want bleeding edge software. Recommended for C/C++ developers where latest GCC is needed.

  • Debian 9/ Ubuntu 18.04-18.10: If you're aiming for stability and maximum package availability. Recommended if you want to target a distribution with a large userbase.

@Sneezry
Copy link

Sneezry commented Mar 12, 2019

I tested on Azure with Ubuntu 18.04, and I got #121 error.

If someone saw this comment wanna run this project on Azure, I do not think Ubuntu 18.04 is a good option.

@hbjydev
Copy link

hbjydev commented Mar 12, 2019

Hey Sneezry, try it again but make the folder "BACKUPS" in /root/.code-server and try again, Azure's Ubuntu will be no different from GCP's Ubuntu other than specific services that they run tailored to their hosting companies.

@Sneezry
Copy link

Sneezry commented Mar 12, 2019

Hi @haydennyyy , thanks for your advice. I did do that, but it doesn't work for me. It just tries to open workspace.json, and throws no such file error.

@sr229
Copy link
Contributor

sr229 commented Mar 12, 2019

@Sneezry that error is a minor bug and does not affect user experience. If the server fails to load, you forgot to install net-tools.

@Sneezry
Copy link

Sneezry commented Mar 12, 2019

@sr229 still not work :-(

Snipaste_2019-03-12_12-02-51

@sr229
Copy link
Contributor

sr229 commented Mar 13, 2019

@Sneezry it seems your instance is not on the local host, do you have any reverse proxies installed? If so, you need to configure your proxy to point it there.

@sr229
Copy link
Contributor

sr229 commented Mar 13, 2019

Otherwise, if this is on a cloud provider, check your firewall rules if the firewall allows incoming HTTP for all ports.

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

7 participants