[17181] | 1 | # This Dockerfile builds ikoba from local sources. |
---|
| 2 | # Create a source package first: |
---|
| 3 | # $ python setup.py sdist |
---|
| 4 | # which should create a .tar.gz package in dist/. |
---|
| 5 | # The version of this package must be set below. |
---|
| 6 | # |
---|
| 7 | # Please note, that we do not set valid configuration values in etc/paypal.conf |
---|
| 8 | # but simply use the sample configuration. |
---|
| 9 | # |
---|
| 10 | |
---|
| 11 | FROM ubuntu:20.04 |
---|
| 12 | ARG IKOBA_VERSION=0.2.dev0 |
---|
| 13 | |
---|
| 14 | MAINTAINER Uli Fouquet <uli@waeup.org> |
---|
| 15 | |
---|
| 16 | ARG DEBIAN_FRONTEND=noninteractive |
---|
| 17 | RUN apt-get update && apt-get install -y tzdata |
---|
| 18 | RUN apt-get install -y apt-utils build-essential |
---|
| 19 | RUN apt-get install -y python2.7-dev libxml2-dev libxslt1-dev \ |
---|
| 20 | zlib1g-dev python3-virtualenv |
---|
| 21 | # see https://urllib3.readthedocs.org/en/latest/security.html#openssl-pyopenssl |
---|
| 22 | RUN apt-get install -y libssl-dev libffi-dev |
---|
| 23 | # libs needed/useful for Pillow image manipulations |
---|
| 24 | RUN apt-get install -y libjpeg-dev libfreetype6-dev libtiff-dev libopenjp2-7-dev |
---|
| 25 | RUN apt-get install -y sudo git wget |
---|
| 26 | |
---|
| 27 | # fix link needed by Pillow |
---|
| 28 | RUN ln -s /usr/include/freetype2 /usr/include/freetype2/freetype |
---|
| 29 | |
---|
| 30 | # add user `ikoba` |
---|
| 31 | RUN useradd -ms /bin/bash ikoba |
---|
| 32 | # set password of user `ikoba` and add to group 'sudo' |
---|
| 33 | RUN echo ikoba:ikoba | chpasswd && adduser ikoba sudo |
---|
| 34 | |
---|
| 35 | # get sources |
---|
| 36 | WORKDIR /home/ikoba |
---|
| 37 | ADD dist/waeup.ikoba-${IKOBA_VERSION}.tar.gz /home/ikoba/ |
---|
| 38 | RUN mv waeup.ikoba-${IKOBA_VERSION} waeup.ikoba |
---|
| 39 | |
---|
| 40 | # make sure, all added files belong to `ikoba` |
---|
| 41 | RUN chown -R ikoba:ikoba /home/ikoba/ |
---|
| 42 | |
---|
| 43 | USER ikoba |
---|
| 44 | ENV HOME /home/ikoba |
---|
| 45 | |
---|
| 46 | # create a virtual env |
---|
| 47 | RUN virtualenv -p /usr/bin/python2.7 py27 |
---|
| 48 | |
---|
| 49 | # install ikoba -- this is the heavy part... |
---|
| 50 | WORKDIR /home/ikoba/waeup.ikoba |
---|
| 51 | RUN /home/ikoba/py27/bin/pip install --upgrade pip==20.3.4 |
---|
| 52 | RUN /home/ikoba/py27/bin/pip install --upgrade --force-reinstall setuptools==44.1.1 |
---|
| 53 | RUN /home/ikoba/py27/bin/pip install "zc.buildout<3" |
---|
| 54 | RUN /home/ikoba/py27/bin/buildout |
---|
| 55 | |
---|
| 56 | # install a paypal.conf with fake data |
---|
| 57 | RUN cp etc/paypal-testing.conf-sample etc/paypal.conf |
---|
| 58 | |
---|
| 59 | # this dir will contain data you might want to be persistent |
---|
| 60 | VOLUME ["/home/ikoba/waeup.ikoba/var/"] |
---|
| 61 | |
---|
| 62 | CMD /home/ikoba/waeup.ikoba/bin/ikobactl fg |
---|