diff --git a/CHANGELOG.rst b/CHANGELOG.rst deleted file mode 100644 index 81d679a..0000000 --- a/CHANGELOG.rst +++ /dev/null @@ -1,28 +0,0 @@ -Changelog -========= - -3.27 (2017-10-05) ------------------ - -* Add PCRE support -* Upgrade to python 3.6.3 - - -3.26 (2017-08-16) ------------------ - -* Add support for postgis -* Add workaround for stack size due to musl-c limitations - - -3.25 (2017-08-15) ------------------ - -* Upgrade to python 3.6.2 -* Install ghostscript-dev and imagemagick-dev in the dev image - - -3.24 (201x-xx-xx) ------------------ - -* Initial release diff --git a/py2.7-slim-stretch/CHANGELOG.rst b/py2.7-slim-stretch/CHANGELOG.rst new file mode 100644 index 0000000..4820240 --- /dev/null +++ b/py2.7-slim-stretch/CHANGELOG.rst @@ -0,0 +1,9 @@ +Changelog +========= + +4.2 (2018-08-14) +---------------- + +* Introduce a CHANGELOG. +* Upgrade to Python 2.7.15. +* Upgrade system to latest available packages. diff --git a/py2.7-slim-stretch/Dockerfile b/py2.7-slim-stretch/Dockerfile index e3f9133..27014ba 100644 --- a/py2.7-slim-stretch/Dockerfile +++ b/py2.7-slim-stretch/Dockerfile @@ -1,4 +1,4 @@ -FROM python:2.7.14-slim-stretch AS build +FROM python:2.7.15-slim-stretch AS build ARG TARGET=prod diff --git a/py2.7-slim-stretch/stack/install.sh b/py2.7-slim-stretch/stack/install.sh index 0a53e2c..bce9390 100755 --- a/py2.7-slim-stretch/stack/install.sh +++ b/py2.7-slim-stretch/stack/install.sh @@ -22,6 +22,9 @@ mkdir -p /usr/share/man/man7/ # Update package listings apt-get update +# Update system +apt-get upgrade + # # SYSTEM PACKAGES # diff --git a/py3.6-alpine3.6/CHANGELOG.rst b/py3.6-alpine3.6/CHANGELOG.rst new file mode 100644 index 0000000..4280c64 --- /dev/null +++ b/py3.6-alpine3.6/CHANGELOG.rst @@ -0,0 +1,9 @@ +Changelog +========= + +4.7 (2018-08-14) +---------------- + +* Introduce a CHANGELOG. +* Upgrade to Python 3.6.6. +* Add the mailcap package to provide mimetypes. diff --git a/py3.6-alpine3.6/Dockerfile b/py3.6-alpine3.6/Dockerfile index ffce69d..bebcb4e 100644 --- a/py3.6-alpine3.6/Dockerfile +++ b/py3.6-alpine3.6/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.6.4-alpine3.6 AS build +FROM python:3.6.6-alpine3.6 AS build ARG TARGET=prod ENV PATH=/root/.local/bin:$PATH @@ -22,6 +22,7 @@ RUN apk add \ libwebp \ libxml2 \ libxslt \ + mailcap \ openjpeg \ pcre \ postgresql-client \ diff --git a/py3.6-alpine3.7/CHANGELOG.rst b/py3.6-alpine3.7/CHANGELOG.rst new file mode 100644 index 0000000..82169ea --- /dev/null +++ b/py3.6-alpine3.7/CHANGELOG.rst @@ -0,0 +1,9 @@ +Changelog +========= + +1.1 (2018-08-14) +---------------- + +* Introduce a CHANGELOG. +* Upgrade to Python 3.6.6. +* Add the mailcap package to provide mimetypes. diff --git a/py3.6-alpine3.7/Dockerfile b/py3.6-alpine3.7/Dockerfile index 74f37bc..0804322 100644 --- a/py3.6-alpine3.7/Dockerfile +++ b/py3.6-alpine3.7/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.6.4-alpine3.7 AS build +FROM python:3.6.6-alpine3.7 AS build ARG TARGET=prod ENV PATH=/root/.local/bin:$PATH @@ -22,6 +22,7 @@ RUN apk add \ libwebp \ libxml2 \ libxslt \ + mailcap \ openjpeg \ pcre \ postgresql-client \ diff --git a/py3.6-alpine3.8/CHANGELOG.rst b/py3.6-alpine3.8/CHANGELOG.rst new file mode 100644 index 0000000..39b70a7 --- /dev/null +++ b/py3.6-alpine3.8/CHANGELOG.rst @@ -0,0 +1,7 @@ +Changelog +========= + +1.0 (2018-08-14) +---------------- + +* Initial release of Python 3.6 / Alpine 3.8 base image. diff --git a/py3.6-alpine3.8/Dockerfile b/py3.6-alpine3.8/Dockerfile new file mode 100644 index 0000000..b905b82 --- /dev/null +++ b/py3.6-alpine3.8/Dockerfile @@ -0,0 +1,99 @@ +FROM python:3.6.6-alpine3.8 AS build + +ARG TARGET=prod +ENV PATH=/root/.local/bin:$PATH + +# Add edge packages +RUN echo @edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories +RUN echo @edge http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories +RUN echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories +RUN apk update && apk upgrade + +# Dependencies +RUN apk add \ + curl \ + freetype \ + gdal@edge \ + gettext \ + jpeg \ + lcms2 \ + libffi \ + libressl2.7-libtls \ + libwebp \ + libxml2 \ + libxslt \ + mailcap \ + openjpeg \ + pcre \ + postgresql-client \ + postgresql-libs \ + proj4@edge \ + tiff \ + tini \ + yaml + +RUN if [ "$TARGET" = "dev" ] ; then apk add \ + freetype-dev \ + g++ \ + gcc \ + gdal-dev@edge \ + gfortran \ + ghostscript-dev \ + imagemagick-dev \ + jpeg-dev \ + lapack-dev \ + lcms2-dev \ + libffi-dev \ + libressl-dev \ + libwebp-dev \ + libxml2-dev \ + libxslt-dev \ + linux-headers \ + make \ + musl-dev \ + openjpeg-dev \ + pcre-dev \ + postgresql-dev \ + proj4-dev@edge \ + readline-dev \ + tiff-dev \ + yaml-dev \ + zlib-dev \ + ; fi + +# Python environment setup +RUN curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python +RUN /root/.local/venvs/pipsi/bin/pip install virtualenv +RUN ln -s /root/.local/venvs/pipsi/bin/virtualenv /root/.local/bin/virtualenv + +RUN pipsi install pip-reqs==0.5 +# `start` has no requirements, install through pip instead of pipsi to save +# some space by avoiding to setup a full virtualenv. +RUN pip install start==0.2 +RUN if [ "$TARGET" = "dev" ] ; then pipsi install 'https://github.com/aldryncore/pip-tools/archive/1.9.0.1.tar.gz#egg=pip-tools==1.9.0.1' ; fi + +COPY add_addons_dev_to_syspath.py /usr/local/lib/python3.6/site-packages/add_addons_dev_to_syspath.py +RUN echo 'import add_addons_dev_to_syspath' >/usr/local/lib/python3.6/site-packages/add_addons_dev_to_syspath.pth +# Workaround for stack size issues on musl-c, see the following URL for details: +# https://github.com/voidlinux/void-packages/issues/4147 +RUN echo 'import threading; threading.stack_size(8 * 1024 ** 2)' >/usr/local/lib/python3.6/site-packages/set_threads_stack_size.pth + +# Cleanup +RUN rm -rf /root/.cache + +# Application environment setup +RUN mkdir -p /app + + +FROM scratch +COPY --from=build / / + +# Execution environment setup +ENV WHEELS_PLATFORM=alpine37-py36 \ + PROCFILE_PATH=/app/Procfile \ + PATH=/root/.local/bin:$PATH \ + NGINX_CONF_PATH=/dev/null +WORKDIR /app +EXPOSE 80/tcp 443/tcp +ENTRYPOINT ["/sbin/tini", "--"] +CMD ["start", "web"] diff --git a/py3.6-alpine3.8/add_addons_dev_to_syspath.py b/py3.6-alpine3.8/add_addons_dev_to_syspath.py new file mode 100644 index 0000000..c780d76 --- /dev/null +++ b/py3.6-alpine3.8/add_addons_dev_to_syspath.py @@ -0,0 +1,17 @@ +""" +Adds all directories in /app/addons-dev to sys.path. +""" +import os +import sys + + +base_path = os.environ.get('ADDONS_DEV_PATH', '/app/addons-dev') + +if os.path.exists(base_path): + all_directories_in_base_path = next(os.walk(base_path))[1] + for pkg in sorted(all_directories_in_base_path, reverse=True): + # sorted in reverse so they end up in alphabetical order + # (insert(0) reverses the order) + pkg_dir = os.path.join(base_path, pkg) + if pkg_dir not in sys.path: + sys.path.insert(0, pkg_dir) diff --git a/py3.6-slim-stretch/CHANGELOG.rst b/py3.6-slim-stretch/CHANGELOG.rst new file mode 100644 index 0000000..db87c36 --- /dev/null +++ b/py3.6-slim-stretch/CHANGELOG.rst @@ -0,0 +1,9 @@ +Changelog +========= + +4.9 (2018-08-14) +---------------- + +* Introduce a CHANGELOG. +* Upgrade to Python 3.6.6. +* Upgrade system to latest available packages. diff --git a/py3.6-slim-stretch/Dockerfile b/py3.6-slim-stretch/Dockerfile index 7a1c87f..bee5aa6 100644 --- a/py3.6-slim-stretch/Dockerfile +++ b/py3.6-slim-stretch/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.6.4-slim-stretch AS build +FROM python:3.6.6-slim-stretch AS build ARG TARGET=prod diff --git a/py3.6-slim-stretch/stack/install.sh b/py3.6-slim-stretch/stack/install.sh index 0a53e2c..bce9390 100755 --- a/py3.6-slim-stretch/stack/install.sh +++ b/py3.6-slim-stretch/stack/install.sh @@ -22,6 +22,9 @@ mkdir -p /usr/share/man/man7/ # Update package listings apt-get update +# Update system +apt-get upgrade + # # SYSTEM PACKAGES #