source: main/waeup.kofa/trunk/Dockerfile @ 17931

Last change on this file since 17931 was 17307, checked in by uli, 22 months ago

Upgrade more build tools (pip/buildout).

With the upgraded Paste tools (last commit), we can use modernly packaged
eggs and can use newer versions of zc.buildout and pip. This does not only
ease the build process but is also necessary to get everything
Python3-compatible.

File size: 2.3 KB
Line 
1FROM ubuntu:22.04
2ARG KOFA_VERSION=1.8.2.dev0
3
4MAINTAINER Uli Fouquet <uli@waeup.org>
5
6ARG DEBIAN_FRONTEND=noninteractive
7RUN apt-get update && apt-get install -y tzdata
8RUN apt-get install -y apt-utils build-essential
9RUN apt-get install -y python2.7-dev libxml2-dev libxslt1-dev \
10                       zlib1g-dev python3-virtualenv
11# see https://urllib3.readthedocs.org/en/latest/security.html#openssl-pyopenssl
12RUN apt-get install -y libssl-dev libffi-dev
13# libs needed/useful for Pillow image manipulations
14RUN apt-get install -y libjpeg-dev libfreetype6-dev libtiff-dev libopenjp2-7-dev
15# helpers not strictly necessary for running kofa but for setup and development
16RUN apt-get install -y sudo git wget pwgen xmlstarlet
17
18# add user `kofa`
19RUN useradd -ms /bin/bash kofa
20# set password of user `kofa` and add to group 'sudo'
21RUN echo kofa:kofa | chpasswd && adduser kofa sudo
22
23USER kofa
24ENV HOME /home/kofa
25WORKDIR /home/kofa
26
27# create a virtual env
28RUN virtualenv -p /usr/bin/python2.7 py27
29
30# get sources
31
32# we can work with official PyPI sources...
33# RUN /home/kofa/py27/bin/pip download --no-binary --no-deps waeup.kofa==${KOFA_VERSION}
34## ...OR with local kofa sources (create a source pkg with `python setup.py sdist`)
35## Please keep one of the two lines above and below commented out.
36COPY --chown=kofa:kofa dist/waeup.kofa-${KOFA_VERSION}.tar.gz /home/kofa
37RUN tar -xzf waeup.kofa-${KOFA_VERSION}.tar.gz
38RUN rm waeup.kofa-${KOFA_VERSION}.tar.gz
39RUN mv waeup.kofa-${KOFA_VERSION} waeup.kofa
40
41## make sure, all added files belong to `kofa`
42#RUN chown -R kofa:kofa /home/kofa/
43
44# install kofa -- this is the heavy part...
45WORKDIR /home/kofa/waeup.kofa
46
47# set random secrets for cookies
48RUN xmlstarlet edit -L -P -S -N x="http://namespaces.zope.org/browser" --update "//x:beakerSession/@secret" --value `pwgen -s -1 20` etc/site.zcml.in
49RUN xmlstarlet edit -L -P -S -N x="http://namespaces.zope.org/browser" --update "//x:beakerSession/@validate_key" --value "val_"`pwgen -s -1 16` etc/site.zcml.in
50
51# upgrade/pin down build helpers and run the build process
52RUN /home/kofa/py27/bin/pip install --upgrade pip zc.buildout
53RUN /home/kofa/py27/bin/pip install --upgrade --force-reinstall setuptools==44.1.1
54RUN /home/kofa/py27/bin/buildout
55
56# this dir will contain data you might want to be persistent
57VOLUME ["/home/kofa/waeup.kofa/var/"]
58
59CMD /home/kofa/waeup.kofa/bin/kofactl fg
Note: See TracBrowser for help on using the repository browser.