forked from CenterForOpenScience/modular-file-renderer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
96 lines (84 loc) · 3.01 KB
/
Copy pathDockerfile
File metadata and controls
96 lines (84 loc) · 3.01 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
FROM python:3.5-slim-jessie
# ensure unoconv can locate the uno library
ENV PYTHONPATH=/usr/lib/python3/dist-packages
RUN usermod -d /home www-data \
&& chown www-data:www-data /home \
&& apt-get update \
# mfr dependencies
&& apt-get install -y \
git \
make \
gcc \
build-essential \
gfortran \
r-base \
libblas-dev \
libevent-dev \
libfreetype6-dev \
libjpeg-dev \
libpng12-dev \
libtiff5-dev \
libxml2-dev \
libxslt1-dev \
zlib1g-dev \
# convert .step to jsc3d-compatible format
freecad \
# pspp dependencies
pspp \
# gosu dependencies
curl \
gnupg2 \
# gosu
&& export GOSU_VERSION='1.10' \
&& for key in \
# GOSU
B42F6819007F00F88E364FD4036A9C25BF357DD4 \
; do \
gpg --keyserver hkp://ipv4.pool.sks-keyservers.net:80 --recv-keys "$key" || \
gpg --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys "$key" || \
gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" || \
gpg --keyserver hkp://keyserver.pgp.com:80 --recv-keys "$key" \
; done \
&& curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
&& gpg --verify /usr/local/bin/gosu.asc \
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
# /gosu
&& apt-get clean \
&& apt-get autoremove -y \
curl \
&& rm -rf /var/lib/apt/lists/* \
&& pip install -U pip \
&& pip install setuptools==37.0.0 \
&& mkdir -p /code
ENV LIBREOFFICE_VERSION 6.0.2.1
ENV LIBREOFFICE_ARCHIVE LibreOffice_6.0.2.1_Linux_x86-64_deb.tar.gz
ENV LIBREOFFICE_MIRROR_URL https://downloadarchive.documentfoundation.org/libreoffice/old/
RUN apt-get update \
&& apt-get install -y \
curl \
&& gpg --keyserver pool.sks-keyservers.net --recv-keys AFEEAEA3 \
&& curl -SL "$LIBREOFFICE_MIRROR_URL/$LIBREOFFICE_VERSION/deb/x86_64/$LIBREOFFICE_ARCHIVE" -o $LIBREOFFICE_ARCHIVE \
&& curl -SL "$LIBREOFFICE_MIRROR_URL/$LIBREOFFICE_VERSION/deb/x86_64/$LIBREOFFICE_ARCHIVE.asc" -o $LIBREOFFICE_ARCHIVE.asc \
&& gpg --verify "$LIBREOFFICE_ARCHIVE.asc" \
&& mkdir /tmp/libreoffice \
&& tar -xvf "$LIBREOFFICE_ARCHIVE" -C /tmp/libreoffice/ --strip-components=1 \
&& dpkg -i /tmp/libreoffice/**/*.deb \
&& rm $LIBREOFFICE_ARCHIVE* \
&& rm -Rf /tmp/libreoffice \
&& apt-get clean \
&& apt-get autoremove -y \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN pip install unoconv==0.8.2
WORKDIR /code
COPY ./requirements.txt ./
RUN pip install --no-cache-dir -r ./requirements.txt
# Copy the rest of the code over
COPY ./ ./
ARG GIT_COMMIT=
ENV GIT_COMMIT ${GIT_COMMIT}
RUN python setup.py develop
EXPOSE 7778
CMD ["gosu", "www-data", "invoke", "server"]