Skip to content

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

Closed

Description

@zanhk

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.

Activity

  1. NGTmeaty commented on Mar 9, 2019

    @NGTmeaty
    Contributor

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

  2. mko-x commented on Mar 9, 2019

    @mko-x

    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
    
  3. sr229 commented on Mar 10, 2019

    @sr229
    Contributor

    @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.

  4. Sneezry commented on Mar 12, 2019

    @Sneezry

    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.

  5. hbjydev commented on Mar 12, 2019

    @hbjydev

    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.

  6. Sneezry commented on Mar 12, 2019

    @Sneezry

    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.

  7. sr229 commented on Mar 12, 2019

    @sr229
    Contributor

    @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.

  8. Sneezry commented on Mar 12, 2019

    @Sneezry

    @sr229 still not work :-(

    Snipaste_2019-03-12_12-02-51

  9. sr229 commented on Mar 13, 2019

    @sr229
    Contributor

    @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.

  10. sr229 commented on Mar 13, 2019

    @sr229
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions