Files
dg-js-workspace/.devcontainer/Dockerfile
T
2026-11-21 22:57:24 +08:00

37 lines
820 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 常用包
ARG node_modules = "typescript tslint-to-eslint-config prettier"
# 以 -g 方式安装
RUN su node -c "umask 0002 && npm install -g ${node_modules}" \
&& npm cache clean --force > /dev/null 2>&1
# 工作目录
WORKDIR /workspace
# 挂载卷
VOLUME /workspace
# 复制程序代码
COPY . .
# 暴露常用端口,http,vite
EXPOSE 8080 5173
# 默认启用命令行
CMD ["bash"]
# 复制宿主机的时区,覆盖容器的时区,避免时间不同步问题,无额外依赖
RUN ln -sf /usr/share/zoneinfo/PRC /etc/localtime
# 安装核心工具集和 CA 证书
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
wget \
vim \
git \
zsh && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*