学习是一个逐步发现自己无知的过程!

Dockerfile Nginx


FROM alpine:3.13.6

MAINTAINER liux

ENV MYPATH /tmp
ENV PACK /mnt

WORKDIR $MYPATH

ADD ngx_cache_purge-2.3.tar.gz $PACK
ADD v0.30.tar.gz $PACK
ADD showdoc.tar.gz /www

RUN apk --no-cache add tzdata && \
    sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \
    apk update && \
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    echo "Asia/Shanghai" > /etc/timezone
ENV TZ Asia/Shanghai

RUN apk add --no-cache --virtual .build-deps \
    gcc \
    libc-dev \
    make \
    openssl-dev \
    pcre-dev \
    zlib-dev \
    linux-headers \
    wget \
    gnupg \
    libxslt-dev \
    gd-dev \
    geoip-dev
RUN wget http://nginx.org/download/nginx-1.20.1.tar.gz && tar zxvf nginx-1.20.1.tar.gz && \ 
    rm -f nginx-1.20.1.tar.gz && \
    mkdir /usr/local/nginx && \
    mkdir -p /usr/local/nginx/conf/conf.d 
RUN cd nginx-1.20.1 && ./configure --prefix=/usr/local/nginx --with-http_stub_status_module \
    --with-http_ssl_module --with-http_gzip_static_module --with-http_sub_module \
    && make && make install
RUN ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/ \
    && addgroup www && adduser www -H -D -G www -s /sbin/nologin \
    && chown -R www.www /www \
    && chmod  -R 777 /www

COPY nginx.conf /usr/local/nginx/conf/nginx.conf
COPY doc.sirliu.com.conf /usr/local/nginx/conf/conf.d

EXPOSE 80

CMD ["nginx","-g","daemon off;"]
赞(0)
未经允许不得转载:劉大帥 » Dockerfile Nginx

你的评论可能会一针见血! 抢沙发

登录

找回密码

注册