CentOS CodeServer安装记录

用宝塔下的docker镜像无法像原来一样正常启动。

最后找到的CentOS下用上面的镜像【codercom/code-server:latest】无法配置SSL。

使用官方的独立版本安装方法,在python安装上遇到了问题。。。
访问地址https://coder.com/docs/code-server/latest/install#fedora-centos-rhel-suse

回归宝塔的docker安装方法避免环境冲突,安装后需解决代理配置问题:

  • 设置好域名并取得SSL证书后,配置反向代理,指向IP+端口
    反向代理配置文件如下
#PROXY-START/

location ^~ /
{
    proxy_pass http://45.130.23.206:8444;
    #proxy_set_header Host 45.130.23.206;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_http_version 1.1;
    # proxy_hide_header Upgrade;

    add_header X-Cache $upstream_cache_status;
    #Set Nginx Cache

    #set $static_fileLigRmAjU 0;
    # Set cache header for static files
    
    if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
    {
        set $static_fileLigRmAjU 1;
        expires 1m;
    }
    if ( $static_fileLigRmAjU = 0 )

    {
        add_header Cache-Control no-cache;
    }
}
#PROXY-END/
  • 进入VS Code 界面后,在安装python时,需要返回docker终端,重新配置容器中相应账户的密码(宝塔这个是abc)

PS:在搜索时候又找到了免费可用的在线IDE平台,提供免费的GPU算力,微信扫码登录即可。访问地址>>Cloud Studio (tencent.com)