Dockerfile-nginx-node-2

FROM nginx:latest
# 修改时区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 添加163的源
# 添加nodejs源
# 安装nodejs
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
echo “deb http://mirrors.163.com/debian/ jessie main non-free contrib” > /etc/apt/sources.list && \
echo “deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib” >> /etc/apt/sources.list && \
echo “deb-src http://mirrors.163.com/debian/ jessie main non-free contrib” >> /etc/apt/sources.list && \
echo “deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib” >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y gnupg curl && \
curl –silent https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo “deb http://deb.nodesource.com/node_8.x/ jessie main” >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y nodejs && \
apt-get autoclean && \
apt-get autoremove && \
rm -rfv /var/lib/apt/lists/*

ADD http://192.168.3.2/nginx.conf /etc/nginx/conf.d/default.conf

# 安装yarn
# RUN wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo “deb https://dl.yarnpkg.com/debian/ stable main” | tee /etc/apt/sources.list.d/yarn.list && apt-get update && apt-get install yarn && rm -rf /var/lib/apt/lists/*

# 设置node环境
ENV NPM_CONFIG_LOGLEVEL warn

EXPOSE 80