Code-server在线IDE部署
环境:
Centos 8
下载
下载源码包,运行.install.sh
但是好像没有运行起来,不清楚原因
使用docker部署
docker pull codercom/code-server
docker run -d -p 8888:8080 --env PASSWORD=WZS134125 --name code-server codercom/code-server
docker start code-server
# 运行服务
http://59999.316.18.54:8888
修改配置文件
vim /root/.config/code-server/conf.yaml
修改对应ip和端口以及密码
[root@CJ-server code-server]# cat config.yaml
bind-addr: 0.0.0.0:8520
# 修改为0.0.0.0,默认是127.0.0.1,只能本机登录,要让我们访问设置允许所有,端口号自行设置,需要防火墙放通端口。
auth: password
password: WZS134125
# 登录密码,自行设置
cert: false
# https证书设置,我这里是没有使用的
使用systemctl管理
vim /usr/lib/systemd/system/code-server.service
内容如下:
[root@CJ-server /]# cat /usr/lib/systemd/system/code-server.service
[Unit]
Description=code-server
Documentation=https://docs.cloudreve.org
After=network.target
Wants=network.target
[Service]
ExecStart=/usr/bin/code-server --config=/root/.config/code-server/config.yaml
进程服务的路径 --config 指定配置文件的路径,可以自行修改。
Restart=on-abnormal
RestartSec=5s
KillMode=mixed
StandardOutput=null
StandardError=syslog
[Install]
WantedBy=multi-user.target
[root@CJ-server /]#
保存文件。
systemctl daemon-reload # 刷新
systemctl start code-server #使用进程管理启动code-server
离线安装python扩展
手动下载
选择从vsix安装
把下载好的文件上传到服务器