1 | FROM ubuntu:20.04 |
---|
2 | ARG KOFA_VERSION=1.8.1.dev0 |
---|
3 | |
---|
4 | MAINTAINER Uli Fouquet <uli@waeup.org> |
---|
5 | |
---|
6 | ARG DEBIAN_FRONTEND=noninteractive |
---|
7 | RUN apt-get update && apt-get install -y tzdata |
---|
8 | RUN apt-get install -y apt-utils build-essential |
---|
9 | RUN 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 |
---|
12 | RUN apt-get install -y libssl-dev libffi-dev |
---|
13 | # libs needed/useful for Pillow image manipulations |
---|
14 | RUN apt-get install -y libjpeg-dev libfreetype6-dev libtiff-dev libopenjp2-7-dev |
---|
15 | RUN apt-get install -y sudo git wget |
---|
16 | |
---|
17 | # add user `kofa` |
---|
18 | RUN useradd -ms /bin/bash kofa |
---|
19 | # set password of user `kofa` and add to group 'sudo' |
---|
20 | RUN echo kofa:kofa | chpasswd && adduser kofa sudo |
---|
21 | |
---|
22 | USER kofa |
---|
23 | ENV HOME /home/kofa |
---|
24 | WORKDIR /home/kofa |
---|
25 | |
---|
26 | # create a virtual env |
---|
27 | RUN virtualenv -p /usr/bin/python2.7 py27 |
---|
28 | |
---|
29 | # get sources |
---|
30 | |
---|
31 | # we can work with official PyPI sources... |
---|
32 | RUN /home/kofa/py27/bin/pip download --no-deps waeup.kofa==${KOFA_VERSION} && tar -xzf waeup.kofa-${KOFA_VERSION}.tar.gz |
---|
33 | ## ...OR with local kofa sources (create a source pkg with `python setup.py sdist`) |
---|
34 | ## Please keep one of the two lines above and below commented out. |
---|
35 | # ADD dist/waeup.kofa-${KOFA_VERSION}.tar.gz /home/kofa |
---|
36 | RUN mv waeup.kofa-${KOFA_VERSION} waeup.kofa |
---|
37 | |
---|
38 | ## make sure, all added files belong to `kofa` |
---|
39 | #RUN chown -R kofa:kofa /home/kofa/ |
---|
40 | |
---|
41 | # install kofa -- this is the heavy part... |
---|
42 | WORKDIR /home/kofa/waeup.kofa |
---|
43 | |
---|
44 | # pin down `pip` and `setuptools` - just to ensure we have a fixed set of versions |
---|
45 | RUN /home/kofa/py27/bin/pip install --upgrade pip==20.3.4 |
---|
46 | RUN /home/kofa/py27/bin/pip install --upgrade --force-reinstall setuptools==44.1.1 |
---|
47 | # pin down `zc.buildout` - versions >= 3 make entry-points of installed eggs |
---|
48 | # invisible for `pgk_resources` |
---|
49 | RUN /home/kofa/py27/bin/pip install "zc.buildout<3" |
---|
50 | RUN /home/kofa/py27/bin/buildout |
---|
51 | |
---|
52 | # this dir will contain data you might want to be persistent |
---|
53 | VOLUME ["/home/kofa/waeup.kofa/var/"] |
---|
54 | |
---|
55 | CMD /home/kofa/waeup.kofa/bin/kofactl fg |
---|