-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade base images and introduce alpine 3.8
- Loading branch information
Showing
14 changed files
with
171 additions
and
32 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Changelog | ||
========= | ||
|
||
1.0 (2018-08-14) | ||
---------------- | ||
|
||
* Initial release of Python 3.6 / Alpine 3.8 base image. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
|
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