2018-10-28 08:56:24 +01:00
|
|
|
IMAGE sahana
|
2019-02-26 20:24:02 +01:00
|
|
|
LAYER shared/alpine3.9
|
|
|
|
LAYER shared/alpine3.9-python2.7
|
2018-10-28 08:56:24 +01:00
|
|
|
LAYER shared/sahana
|
|
|
|
|
|
|
|
RUN EOF
|
|
|
|
# Install runtime dependencies
|
2019-06-02 11:31:24 +02:00
|
|
|
apk --no-cache add geos nginx py-gdal py2-dateutil py2-lxml py2-numpy py2-pillow py2-psycopg2 py2-requests uwsgi-python
|
2018-10-28 08:56:24 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Install web2py
|
|
|
|
git clone --recursive https://github.com/web2py/web2py.git /srv/web2py
|
|
|
|
git -C /srv/web2py checkout 7035398
|
|
|
|
git -C /srv/web2py submodule update
|
|
|
|
|
|
|
|
# Fix Web2py urllib import (https://github.com/web2py/pydal/commit/9d2290c)
|
|
|
|
sed -i 's/import traceback/import traceback\nimport urllib/' /srv/web2py/gluon/packages/dal/pydal/base.py
|
|
|
|
|
|
|
|
# Symlink WSGI handler
|
|
|
|
ln -s /srv/web2py/handlers/wsgihandler.py /srv/web2py/wsgihandler.py
|
|
|
|
|
|
|
|
# Install Sahana
|
|
|
|
git clone --depth 1 https://github.com/sahana/eden.git /srv/web2py/applications/eden
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Copy fonts with Czech glyphs
|
2019-04-13 20:49:19 +02:00
|
|
|
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
|
2018-10-28 08:56:24 +01:00
|
|
|
EOF
|
|
|
|
|
|
|
|
COPY lxc
|
|
|
|
|
|
|
|
RUN EOF
|
|
|
|
# Create OS user
|
|
|
|
addgroup -S -g 8001 sahana
|
|
|
|
adduser -S -u 8001 -h /srv/web2py -s /bin/false -g sahana -G sahana sahana
|
|
|
|
chown -R sahana:sahana /srv/web2py
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
apk --no-cache del .deps
|
|
|
|
find /srv/web2py -name '.git*' -exec rm -rf {} +
|
|
|
|
rm -r /srv/web2py/applications/admin /srv/web2py/applications/examples /srv/web2py/applications/welcome
|
|
|
|
rm -r /root/.cache
|
|
|
|
EOF
|