Last active
August 6, 2016 20:51
-
-
Save LukeFlynn/933c96be4deba0ab89575c358cc88cea to your computer and use it in GitHub Desktop.
Alpine Nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.3 | |
MAINTAINER Luke Flynn <luke@lukehflynn.com> | |
ENV apk_list="autoconf wget ca-certificates pcre zlib zip tar openssl-dev pcre-dev zlib-dev build-base git patch bash gperf python linux-headers gcc" | |
RUN apk add --no-cache ${apk_list} | |
WORKDIR /tmp | |
# Download Nginx and Nginx modules source | |
RUN mkdir -p /usr/local/src/nginx && \ | |
wget http://nginx.org/download/nginx-1.10.1.tar.gz -O nginx.tar.gz && \ | |
tar -xzvf nginx.tar.gz -C /usr/local/src/nginx | |
# Build Nginx | |
WORKDIR /usr/local/src/nginx/nginx-1.10.1 | |
RUN ./configure \ | |
--prefix=/usr/share/nginx \ | |
--sbin-path=/usr/sbin/nginx \ | |
--conf-path=/etc/nginx/nginx.conf \ | |
--pid-path=/run/nginx.pid \ | |
--lock-path=/run/lock/subsys/nginx \ | |
--error-log-path=/var/log/nginx/error.log \ | |
--http-log-path=/var/log/nginx/access.log \ | |
--with-http_gzip_static_module \ | |
--with-http_stub_status_module \ | |
--with-http_ssl_module \ | |
--with-pcre \ | |
--with-ipv6 \ | |
--with-http_dav_module \ | |
--with-http_v2_module \ | |
--with-http_gunzip_module && \ | |
make && \ | |
make install | |
WORKDIR /usr/local/src/nginx | |
RUN touch /run/nginx.pid | |
RUN rm -rf /etc/nginx/nginx.conf | |
RUN mkdir /var/pagespeed_cache | |
ADD ./nginx.conf /etc/nginx/nginx.conf | |
# Cleanup after Nginx build | |
#RUN apk del ${apk_list} | |
# PORTS | |
EXPOSE 80 443 | |
ENTRYPOINT ["/usr/sbin/nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment