FROM centos:8
RUN cd /etc/yum.repos.d/
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
RUN yum clean all
RUN yum makecache
RUN yum update -y
# 安装依赖软件包
RUN yum install -y \
curl \
zlib-devel \
openssl-devel \
libffi-devel \
sqlite-devel \
python39-devel.x86_64 \
python39-libs.x86_64 \
python39.x86_64 \
npm
# 安装Node.js
RUN yum install -y nodejs
# 安装Python 3
RUN yum install -y python3.9
RUN yum install -y python3-pip
USER root
WORKDIR /xxx_platform
COPY . /xxx_platform
RUN chmod a+xr -R /xxx_platform/
RUN python3.9 -m pip install --index-url=http://mirrors.aliyun.com/pypi/simple --default-timeout=100000 -r requirements.txt --trusted-host mirrors.aliyun.com
# 对外暴露的接口
EXPOSE 6999 5173
# 当容器启动时运行start.sh文件
#CMD sh /start.sh&&tail -f /dev/null
RUN npm install -g n && n 18.17.1
RUN npm install -g npm@10.1.0
#RUN npm cache clean -f
#RUN npm config set ELECTRON_MIRROR http://npmmirror.com/mirrors/electron
#RUN npm config delete ELECTRON_MIRROR
#RUN npm config ls
RUN npm install cnpm -g
RUN cnpm install dayjs --save
RUN cnpm install http-server -g
CMD ["sh", "start.sh"]
dockerfile安装centos python 和 nodejs示例
最新推荐文章于 2024-03-29 08:35:51 发布