-
Notifications
You must be signed in to change notification settings - Fork 74
/
Dockerfile.monitor.dev
47 lines (38 loc) · 2.16 KB
/
Dockerfile.monitor.dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM python:3.6.15
# 更换debian源
RUN rm /etc/apt/sources.list \
&& echo "deb https://mirrors.cloud.tencent.com/debian/ buster main contrib non-free \n\
deb https://mirrors.cloud.tencent.com/debian/ buster-updates main contrib non-free \n\
deb https://mirrors.cloud.tencent.com/debian/ buster-backports main contrib non-free \n\
deb https://mirrors.cloud.tencent.com/debian-security/ buster/updates main contrib non-free \n\
deb-src https://mirrors.cloud.tencent.com/debian/ buster main contrib non-free \n\
deb-src https://mirrors.cloud.tencent.com/debian/ buster-updates main contrib non-free \n\
deb-src https://mirrors.cloud.tencent.com/debian/ buster-backports main contrib non-free \n\
deb-src https://mirrors.cloud.tencent.com/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list
# 安装工具包及npm
RUN apt update && apt install -y curl wget git vim supervisor \
&& curl -fsSL https://code-server.dev/install.sh | sh \
&& mkdir -p /usr/local/lib/nodejs \
&& wget https://nodejs.org/download/release/v18.18.2/node-v18.18.2-linux-x64.tar.xz \
&& tar -xvf node-v18.18.2-linux-x64.tar.xz -C /usr/local/lib/nodejs \
&& echo 'export PATH=/usr/local/lib/nodejs/node-v18.18.2-linux-x64/bin:$PATH' >> ~/.bashrc
# 安装code-server插件
RUN code-server --install-extension ms-python.python && \
code-server --install-extension Equinusocio.vsc-material-theme && \
code-server --install-extension equinusocio.vsc-material-theme-icons && \
code-server --install-extension xyz.local-history && \
code-server --install-extension eamodio.gitlens
# npm加入PATH环境变量
ENV PATH="/usr/local/lib/nodejs/node-v18.18.2-linux-x64/bin:${PATH}"
RUN npm install -g npm@latest pnpm
# 安装python依赖
RUN pip install --upgrade --no-cache-dir pip==20.2.3 setuptools==57.5.0
COPY bkmonitor/scripts/dev/run.sh /app/
RUN chmod +x /app/run.sh
# 复制supervisor/code-server启动配置
COPY bkmonitor/scripts/dev/supervisord.conf bkmonitor/scripts/dev/code-server.yaml /app/etc/
# 复制监控代码目录
COPY ./ /app/code/
COPY bkmonitor/scripts/dev/local_settings.py.tpl /app/code/bkmonitor/local_settings.py
WORKDIR /app/code
CMD /app/run.sh