title: Docker安装vscode-web tags: [] id: '2621' categories:
version: "2.1"
services:
code-server:
image: linuxserver/code-server:latest
container_name: code-server
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Shanghai
- PASSWORD=password
- SUDO_PASSWORD=password
- PROXY_DOMAIN=code-server.my.domain #optional
- DEFAULT_WORKSPACE=/config/workspace #optional
volumes:
- ./config:/config
ports:
- 2441:8443
restart: unless-stopped
mkdir -p ~/app/vscode && cd ~/app/vscode && nano docker-compose.yml
sudo docker-compose up -d && sudo docker-compose logs
打开Visual Studio Code,点击Manage,在列表中选择Settings
在弹出的搜索框中输入"proxy",即可看到代理的配置项"Http:Proxy"
宿主机获取docker0的ip: ip address grep docker0
然后docker内设置代理 http://docker0的ip:port
拓展内搜索zh-cn,安装中文界面拓展
回到WORKSPACE,ctrl+~ 调出终端
sudo sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
sudo apt update
sudo apt install wget
wget https://mirrors.bfsu.edu.cn/anaconda/miniconda/Miniconda3-py39_23.1.0-1-Linux-x86_64.sh -O conda_install.sh
chmod +x conda_install.sh && ./conda_install.sh
宿主机执行 sudo docker-compose restart # 重启容器使conda生效
nano -K ~/.condarc # 清华镜像源
conda clean -i # 清除索引缓存,保证用的是镜像站提供的索引
conda create -n node -c conda-forge nodejs
conda activate node
npm config set registry https://registry.npmmirror.com
npm create astro@latest
git config --global user.email "youremail"
git config --global user.name "yourname"
git branch -M main && git add . && git commit -m 'Initial commit'
git remote add origin https://github.com/Limour-dev/chatGPT.git
git push --set-upstream origin main --force # Creating a personal access token
git config --global credential.helper cache
git push
---
const search = Astro.url.searchParams.get('search')! '';
---
<h1>{search}</h1>
编辑 chatGPT/src/pages/index.astro
npm run dev