Skip to main content

Docker部署Code-server

note

Coder-server是一款开源的在线IDE。

Code-server官方安装文档
Code-server Docker install

安装Code-server

  1. 创建目录并授权

    mkdir -p -m 750 /opt/codeserver/config/
    chown -R 1000:1000 /opt/codeserver/config/
  2. 编辑docker-compose.yml文件

    version: "2.1"
    services:
    code-server:
    image: lscr.io/linuxserver/code-server:latest
    container_name: code-server
    environment:
    - PUID=1000
    - PGID=1000
    - TZ=Asia/Shanghai
    - PASSWORD=password #optional
    - HASHED_PASSWORD= #optional
    - SUDO_PASSWORD=password #optional
    - SUDO_PASSWORD_HASH= #optional
    - PROXY_DOMAIN=ide.example.com #optional
    - DEFAULT_WORKSPACE=/config/workspace #optional
    volumes:
    - /opt/codeserver/config:/config
    ports:
    - 8443:8443
    restart: unless-stopped