feat: code-server
Some checks are pending
continuous-integration/drone/push Build is running

This commit is contained in:
范胜发
2024-02-22 15:17:02 +08:00
parent 3d60320ccf
commit c56d49e6ff
2 changed files with 15 additions and 6 deletions

View File

@ -5,12 +5,10 @@ WORKDIR /app
COPY . . COPY . .
VOLUME [ "/data", "/root/.ssh", "/root/.vscode-server" ] VOLUME [ "/project", "/root/.ssh", "/root/.local", "/root/.config" ]
# 运行时可以添加代理 # 运行时可以添加代理
ARG PROXY ARG PROXY
# ENV https_proxy=${PROXY}
# ENV http_proxy=${PROXY}
# 安装基础工具与配置文件 # 安装基础工具与配置文件
RUN echo "安装基础工具与配置文件" && \ RUN echo "安装基础工具与配置文件" && \
@ -47,9 +45,9 @@ RUN echo "安装 node 环境" && \
# 安装 n node 管理器 # 安装 n node 管理器
brew install n && \ brew install n && \
# 安装最新版本 node # 安装最新版本 node
n stable && \ n 18.15.0
# 安装 web 服务器 # 安装 web 服务器
npm i -g live-server # npm i -g live-server
# 安装 python 环境 # 安装 python 环境
RUN echo "安装 python 环境" && \ RUN echo "安装 python 环境" && \
@ -79,5 +77,16 @@ RUN echo "配置 ssh" && \
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N '' && \ ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N '' && \
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config
# 安装 code-server
RUN echo "安装 code-server" && \
export http_proxy=${PROXY} && \
export https_proxy=${PROXY} && \
apt update && \
# apt-get install -y build-essential pkg-config python3 && \
apt install -y pkg-config && \
npm config set python python3 && \
npm install --global code-server --unsafe-perm
ENTRYPOINT ["/app/docker-entry-point.sh"] ENTRYPOINT ["/app/docker-entry-point.sh"]

View File

@ -29,4 +29,4 @@ fi
service ssh start >> /app/info.log service ssh start >> /app/info.log
ssh-agent bash >> /app/info.log ssh-agent bash >> /app/info.log
tail -f /app/info.log code-server