Dockerfile 1.18 KB
Newer Older
1
FROM python:3-slim-stretch
Livius's avatar
Livius committed
2 3 4 5 6 7 8 9 10 11 12

RUN apt-get update && apt-get install -y \
    autoconf \
    automake \
    autotools-dev \
    libev4 \
    libsigsegv2 \
    m4 \
    nginx-light \
    python3-crypto \
    python3-dev \
13
    python3-dnspython \
Livius's avatar
Livius committed
14 15 16 17
    python3-flask \
    python3-flask-sqlalchemy \
    python3-jwt \
    python3-sqlalchemy \
18
    python3-publicsuffix \
19
    python3-tz \
Livius's avatar
Livius committed
20 21 22 23 24 25 26
    sqlite3 \
    systemd \
    unbound \
    unbound-anchor \
    uwsgi \
    uwsgi-plugin-python3

27
VOLUME /etc/system-configuration
Livius's avatar
Livius committed
28

29
RUN mkdir -p /etc/nginx/ssl
Livius's avatar
Livius committed
30
COPY id4me /usr/local/lib/id4me
31
RUN ln -s /etc/system-configuration/nginx/id4me /etc/nginx/sites-enabled/id4me
Andreea Dima's avatar
Andreea Dima committed
32
RUN ln -s /etc/system-configuration/nginx/id4me-http /etc/nginx/sites-enabled/id4me-http
Livius's avatar
Livius committed
33 34 35 36
RUN rm /etc/nginx/sites-enabled/default

RUN cd /usr/lib/python2.7/ && \
    ln -s plat-x86_64-linux-gnu/_sysconfigdata_nd.py .
37
RUN ln -s /etc/system-configuration/id4me/uwsgi.ini /etc/uwsgi/apps-enabled/id4me.conf
Livius's avatar
Livius committed
38 39 40 41 42 43 44 45
RUN chown www-data:www-data -R /usr/local/lib/id4me/

WORKDIR /usr/local/lib/id4me/

VOLUME /usr/local/lib/id4me/id.db

ENV PYTHONPATH /usr/local/lib/

46
EXPOSE 443
47
CMD service nginx restart && uwsgi --ini /etc/system-configuration/id4me/uwsgi.ini