FROM ubuntu:18.04  AS build

MAINTAINER afa

WORKDIR /usr/local/nginx

RUN apt-get update && \
    apt-get install -y libpcre3 libpcre3-dev  zlib1g-dev  build-essential libssl-dev  wget && \
    apt-get install -y git && \
    apt-get install -y  python3.6 && \
    ln -s /usr/bin/python3.6  /usr/bin/python && \
    useradd -M -s /sbin/nologin nginx && \
    apt-get autoremove -y && \
    apt-get clean -y

RUN  wget https://npm.taobao.org/mirrors/node/v14.15.1/node-v14.15.1-linux-x64.tar.xz && \
     tar xf node-v14.15.1-linux-x64.tar.xz -C /usr/local && \
     ln -s /usr/local/node-v14.15.1-linux-x64 /usr/local/node && \
     echo "export PATH=$PATH:/usr/local/node/bin" >>/root/.bashrc && \
     rm -rf  node-v14.15.1-linux-x64.tar.xz

RUN  export PATH=$PATH:/usr/local/node/bin  && \
     npm config set registry https://registry.npm.taobao.org
