-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
72 lines (55 loc) · 2.17 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM ubuntu:latest AS upgrade
RUN set -xe \
&& apt update \
&& apt -y dist-upgrade \
&& rm -rf /var/lib/apt/lists/*
FROM upgrade AS venv
RUN set -xe \
&& apt update \
&& apt install -q -y --no-install-recommends \
build-essential libssl-dev libffi-dev \
python3-dev python3-pip python3-setuptools python3-venv \
git \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN pip3 install uwsgi
COPY . /usr/src/app/
RUN cd /usr/src/app && \
pip3 install -e .
FROM upgrade AS runtime
RUN set -xe \
&& apt update \
&& apt install -q -y --no-install-recommends \
software-properties-common \
&& add-apt-repository ppa:libreoffice/ppa \
&& apt install -q -y --no-install-recommends \
libreoffice-writer supervisor \
&& rm -rf /var/lib/apt/lists/*
RUN set -xe \
&& apt update \
&& echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula boolean true" | debconf-set-selections \
&& apt install -q -y --no-install-recommends \
curl fonts-crosextra-carlito openjdk-8-jdk-headless git gpg-agent unzip \
openssh-client ttf-mscorefonts-installer \
python3-dev python3-minimal python3-pip python3-setuptools python3-uno python3-wheel \
&& rm -rf /var/lib/apt/lists/*
RUN cd /tmp \
&& set -xe \
&& curl -sSLO https://github.com/jgm/pandoc/releases/download/2.9.1.1/pandoc-2.9.1.1-1-amd64.deb \
&& dpkg -i pandoc-2.9.1.1-1-amd64.deb \
&& rm pandoc-2.9.1.1-1-amd64.deb
RUN pip3 install unoconv
RUN useradd -r -d /opt/venv uwsgi
COPY --chown=uwsgi:uwsgi --from=venv /usr/src/app /usr/src/app
COPY --chown=uwsgi:uwsgi --from=venv /opt/venv /opt/venv
ADD .docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD .docker/entrypoint.sh /entrypoint.sh
ADD .docker/install_features.py /usr/local/bin
ADD .docker/install_fonts.py /usr/local/bin
ADD .docker/uwsgi.ini /etc/uwsgi/uwsgi.ini
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/bin/supervisord"]
EXPOSE 8080
EXPOSE 8443
HEALTHCHECK CMD /usr/bin/curl --fail --cacert /etc/ssl/certs/uwsgi.crt --resolve 'docmaker:8443:127.0.0.1' https://docmaker:8443/health?uno || exit 1