Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Add python3 container #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Supported tags and respective `Dockerfile` links

- [`python3.6.2`, `python3.6`, `python3` (*python3/light/Dockerfile*)](https://github.com/disqus/docker-nginx/blob/master/python3/light/Dockerfile)
- [`python2.7.10`, `python2.7`, `python2` (*python2/full/Dockerfile*)](https://github.com/disqus/docker-nginx/blob/master/python2/full/Dockerfile)
- [`python2.7.10-onbuild`, `python2.7-onbuild`, `python2-onbuild`, `latest` (*python2/full/onbuild/Dockerfile*)](https://github.com/disqus/docker-nginx/blob/master/python2/full/onbuild/Dockerfile)
- [`python2.7.10-light`, `python2.7-light`, `python2-light` (*python2/light/Dockerfile*)](https://github.com/disqus/docker-nginx/blob/master/python2/light/Dockerfile)
Expand Down
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ for variant in light full openresty; do
docker push $repo:python$version-onbuild
fi
done

docker build --rm -t $tag ./python3/light
docker tag $tag $repo:python3.6-light
docker push $repo:python3.6-light
76 changes: 76 additions & 0 deletions python3/light/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
FROM python:3.6

RUN gpg --keyserver pool.sks-keyservers.net --recv-keys 520A9993A1C052F8
ENV NGINX_VERSION 1.8.0
ENV NGINX_DOWNLOAD_URL http://nginx.org/download/nginx-1.8.0.tar.gz

RUN modsDir='/usr/src/nginx-modules'; \
set -x \
&& mkdir -p $modsDir/nginx-statsd \
&& curl -sSL https://github.com/zebrafishlabs/nginx-statsd/archive/b756a12.tar.gz \
| tar -zxvC $modsDir/nginx-statsd --strip-components=1 \
&& mkdir -p $modsDir/nginx-echo \
&& curl -sSL https://github.com/openresty/echo-nginx-module/archive/v0.57.tar.gz \
| tar -zxvC $modsDir/nginx-echo --strip-components=1 \
&& mkdir -p /usr/src/nginx \
&& curl -sSL "$NGINX_DOWNLOAD_URL" -o nginx.tar.gz \
&& curl -sSL "$NGINX_DOWNLOAD_URL.asc" -o nginx.tar.gz.asc \
&& gpg --verify nginx.tar.gz.asc \
&& tar -xzf nginx.tar.gz -C /usr/src/nginx --strip-components=1 \
&& rm nginx.tar.gz && rm nginx.tar.gz.asc \
&& ( cd /usr/src/nginx ; ./configure \
--conf-path=/etc/nginx/nginx.conf \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
--lock-path=/var/lock/nginx.lock \
--pid-path=/run/nginx.pid \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--with-pcre-jit \
--with-ipv6 \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_gzip_static_module \
--add-module=$modsDir/nginx-echo \
--without-http_browser_module \
--without-http_geo_module \
--without-http_limit_conn_module \
--without-http_limit_req_module \
--without-http_memcached_module \
--without-http_referer_module \
--without-http_scgi_module \
--without-http_split_clients_module \
--without-http_ssi_module \
--without-http_userid_module \
# this doesn't normally exist in nginx-light... but this is for python, so we want it
# --without-http_uwsgi_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
# extras that aren't included in normal nginx-light
--with-md5-asm \
--with-md5=/usr/include \
--with-sha1-asm \
--with-sha1=/usr/include \
--with-file-aio \
--add-module=$modsDir/nginx-statsd \
) \
&& make -C /usr/src/nginx -j$(nproc) \
&& make -C /usr/src/nginx install \
&& mkdir -p /var/lib/nginx \
&& rm -rf /usr/src/nginx \
&& rm -rf /usr/src/nginx-modules

ENV PATH $PATH:/usr/local/nginx/sbin

# redirect all logs to stderr/stdout
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log

WORKDIR /usr/local/nginx/html
EXPOSE 80 443

CMD [ "nginx", "-g", "daemon off;" ]