From e5c6203412fccea2f84e9991e0f86f8740188f5a Mon Sep 17 00:00:00 2001 From: Disassembler Date: Fri, 7 Feb 2020 18:29:23 +0100 Subject: [PATCH] Bump Sahana to Alpine 3.11 --- lxc-apps/sahana/{lxcfile => image} | 24 +++++++++---------- .../{lxc => image.d}/etc/nginx/nginx.conf | 2 ++ .../etc/services.d/.s6-svscan/finish | 0 .../{lxc => image.d}/etc/services.d/nginx/run | 0 .../etc/services.d/uwsgi/down-signal | 0 .../{lxc => image.d}/etc/services.d/uwsgi/run | 0 .../{lxc => image.d}/etc/uwsgi/uwsgi.conf | 0 .../web2py/applications/eden/languages/cs.py | 0 .../{lxc => image.d}/srv/web2py/routes.py | 0 .../srv/web2py/run_scheduler.py | 0 10 files changed, 13 insertions(+), 13 deletions(-) rename lxc-apps/sahana/{lxcfile => image} (68%) rename lxc-apps/sahana/{lxc => image.d}/etc/nginx/nginx.conf (94%) rename lxc-apps/sahana/{lxc => image.d}/etc/services.d/.s6-svscan/finish (100%) mode change 100755 => 100644 rename lxc-apps/sahana/{lxc => image.d}/etc/services.d/nginx/run (100%) mode change 100755 => 100644 rename lxc-apps/sahana/{lxc => image.d}/etc/services.d/uwsgi/down-signal (100%) rename lxc-apps/sahana/{lxc => image.d}/etc/services.d/uwsgi/run (100%) mode change 100755 => 100644 rename lxc-apps/sahana/{lxc => image.d}/etc/uwsgi/uwsgi.conf (100%) rename lxc-apps/sahana/{lxc => image.d}/srv/web2py/applications/eden/languages/cs.py (100%) rename lxc-apps/sahana/{lxc => image.d}/srv/web2py/routes.py (100%) rename lxc-apps/sahana/{lxc => image.d}/srv/web2py/run_scheduler.py (100%) diff --git a/lxc-apps/sahana/lxcfile b/lxc-apps/sahana/image similarity index 68% rename from lxc-apps/sahana/lxcfile rename to lxc-apps/sahana/image index 0233d50..5908658 100644 --- a/lxc-apps/sahana/lxcfile +++ b/lxc-apps/sahana/image @@ -1,19 +1,16 @@ -IMAGE sahana_0.0.1-190620 -FROM alpine3.9-python2.7_2.7.16-190620 +IMAGE sahana_0.0.1-200207 +FROM alpine3.11-python3.8_3.8.1-200207 RUN EOF # Install runtime dependencies - apk --no-cache add geos@vm nginx py-gdal@vm py2-dateutil py2-lxml py2-numpy py2-pillow py2-psycopg2 py2-requests uwsgi-python + apk --no-cache add geos nginx py3-gdal py3-dateutil py3-lxml py3-numpy py3-pillow py3-psycopg2 py3-requests uwsgi-python3 # Install build dependencies - apk --no-cache add --virtual .deps build-base git freetype-dev libpng-dev py-numpy-dev py2-pip python2-dev ttf-dejavu - - # Hackfix for python find_library('c') call - ln -s /lib/ld-musl-x86_64.so.1 /lib/libc.so.1 + apk --no-cache add --virtual .deps build-base git freetype-dev libpng-dev py3-numpy-dev py3-pip python3-dev ttf-dejavu # Install web2py git clone --recursive https://github.com/web2py/web2py.git /srv/web2py - git -C /srv/web2py checkout 59700b8 + git -C /srv/web2py checkout 6128d03 git -C /srv/web2py submodule update # Symlink WSGI handler @@ -25,22 +22,21 @@ RUN EOF # Install python dependencies, exclude old or unnecessary ones sed -i 's/^ansible/#ansible/' /srv/web2py/applications/eden/optional_requirements.txt sed -i 's/^boto/#boto/' /srv/web2py/applications/eden/optional_requirements.txt - sed -i 's/^PIL/#PIL/' /srv/web2py/applications/eden/optional_requirements.txt sed -i 's/^PyRTF/#PyRTF/' /srv/web2py/applications/eden/optional_requirements.txt sed -i 's/^PyYAML/#PyYAML/' /srv/web2py/applications/eden/optional_requirements.txt - pip install -r /srv/web2py/applications/eden/optional_requirements.txt + pip3 install -r /srv/web2py/applications/eden/optional_requirements.txt # Copy fonts with Czech glyphs cp /usr/share/fonts/ttf-dejavu/DejaVuSerif-Bold.ttf /srv/web2py/applications/eden/static/fonts/Helvetica-Bold.ttf cp /usr/share/fonts/ttf-dejavu/DejaVuSerif.ttf /srv/web2py/applications/eden/static/fonts/Helvetica.ttf EOF -COPY lxc +COPY image.d RUN EOF # Create OS user - addgroup -S -g 8080 sahana - adduser -S -u 8080 -h /srv/web2py -s /bin/false -g sahana -G sahana sahana + addgroup sahana + adduser -h /srv/web2py -s /bin/false -g sahana -G sahana sahana chown -R sahana:sahana /srv/web2py # Cleanup @@ -49,3 +45,5 @@ RUN EOF rm -r /srv/web2py/applications/admin /srv/web2py/applications/examples /srv/web2py/applications/welcome rm -r /root/.cache EOF + +CMD s6-svscan /etc/services.d diff --git a/lxc-apps/sahana/lxc/etc/nginx/nginx.conf b/lxc-apps/sahana/image.d/etc/nginx/nginx.conf similarity index 94% rename from lxc-apps/sahana/lxc/etc/nginx/nginx.conf rename to lxc-apps/sahana/image.d/etc/nginx/nginx.conf index 25ebba8..9a3a7da 100644 --- a/lxc-apps/sahana/lxc/etc/nginx/nginx.conf +++ b/lxc-apps/sahana/image.d/etc/nginx/nginx.conf @@ -15,6 +15,8 @@ http { server_tokens off; client_max_body_size 100m; sendfile on; + tcp_nodelay on; + send_timeout 300; server { listen 8080; diff --git a/lxc-apps/sahana/lxc/etc/services.d/.s6-svscan/finish b/lxc-apps/sahana/image.d/etc/services.d/.s6-svscan/finish old mode 100755 new mode 100644 similarity index 100% rename from lxc-apps/sahana/lxc/etc/services.d/.s6-svscan/finish rename to lxc-apps/sahana/image.d/etc/services.d/.s6-svscan/finish diff --git a/lxc-apps/sahana/lxc/etc/services.d/nginx/run b/lxc-apps/sahana/image.d/etc/services.d/nginx/run old mode 100755 new mode 100644 similarity index 100% rename from lxc-apps/sahana/lxc/etc/services.d/nginx/run rename to lxc-apps/sahana/image.d/etc/services.d/nginx/run diff --git a/lxc-apps/sahana/lxc/etc/services.d/uwsgi/down-signal b/lxc-apps/sahana/image.d/etc/services.d/uwsgi/down-signal similarity index 100% rename from lxc-apps/sahana/lxc/etc/services.d/uwsgi/down-signal rename to lxc-apps/sahana/image.d/etc/services.d/uwsgi/down-signal diff --git a/lxc-apps/sahana/lxc/etc/services.d/uwsgi/run b/lxc-apps/sahana/image.d/etc/services.d/uwsgi/run old mode 100755 new mode 100644 similarity index 100% rename from lxc-apps/sahana/lxc/etc/services.d/uwsgi/run rename to lxc-apps/sahana/image.d/etc/services.d/uwsgi/run diff --git a/lxc-apps/sahana/lxc/etc/uwsgi/uwsgi.conf b/lxc-apps/sahana/image.d/etc/uwsgi/uwsgi.conf similarity index 100% rename from lxc-apps/sahana/lxc/etc/uwsgi/uwsgi.conf rename to lxc-apps/sahana/image.d/etc/uwsgi/uwsgi.conf diff --git a/lxc-apps/sahana/lxc/srv/web2py/applications/eden/languages/cs.py b/lxc-apps/sahana/image.d/srv/web2py/applications/eden/languages/cs.py similarity index 100% rename from lxc-apps/sahana/lxc/srv/web2py/applications/eden/languages/cs.py rename to lxc-apps/sahana/image.d/srv/web2py/applications/eden/languages/cs.py diff --git a/lxc-apps/sahana/lxc/srv/web2py/routes.py b/lxc-apps/sahana/image.d/srv/web2py/routes.py similarity index 100% rename from lxc-apps/sahana/lxc/srv/web2py/routes.py rename to lxc-apps/sahana/image.d/srv/web2py/routes.py diff --git a/lxc-apps/sahana/lxc/srv/web2py/run_scheduler.py b/lxc-apps/sahana/image.d/srv/web2py/run_scheduler.py similarity index 100% rename from lxc-apps/sahana/lxc/srv/web2py/run_scheduler.py rename to lxc-apps/sahana/image.d/srv/web2py/run_scheduler.py