-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (52 loc) · 2.06 KB
/
Dockerfile
File metadata and controls
67 lines (52 loc) · 2.06 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
FROM python:3.7.9-buster
# install LibreOffice Write to convert Word to PDF
# also install fonts and fontconfig to provide common fonts or configuration to their alternatives
RUN apt-get update \
&& apt-get install -y \
libreoffice-writer \
fonts-liberation fonts-liberation2 \
fonts-crosextra-carlito fonts-crosextra-caladea \
fontconfig \
&& rm -rf /var/lib/apt/lists/*
ENV PROJECT_HOME=/srv/sciencebeam-pipelines
ENV VENV=${PROJECT_HOME}/venv
RUN python3 -m venv ${VENV}
ENV PYTHONUSERBASE=${VENV} PATH=${VENV}/bin:$PATH
WORKDIR ${PROJECT_HOME}
COPY requirements.pip.txt ${PROJECT_HOME}/
RUN pip install -r requirements.pip.txt
COPY requirements.build.txt ${PROJECT_HOME}/
RUN pip install -r requirements.build.txt
COPY requirements.prereq.txt ${PROJECT_HOME}/
RUN pip install -r requirements.prereq.txt
COPY requirements.txt ${PROJECT_HOME}/
RUN pip install -r requirements.txt
ARG install_dev
COPY requirements.dev.txt ./
RUN if [ "${install_dev}" = "y" ]; then pip install -r requirements.dev.txt; fi
COPY sciencebeam_pipelines ${PROJECT_HOME}/sciencebeam_pipelines
COPY xslt ${PROJECT_HOME}/xslt
COPY *.cfg *.conf *.sh *.in *.txt *.py ${PROJECT_HOME}/
RUN pip install -e . --no-deps
ARG commit
ARG version
COPY docker ./docker
RUN ./docker/set-version.sh "${version}" "${commit}"
RUN useradd -ms /bin/bash sciencebeam
USER sciencebeam
ENV HOME=/home/sciencebeam
# set and check UNO_PATH, UNO_PYTHON_PATH and UNO_OFFICE_BINARY_PATH
ENV UNO_PATH=/usr/lib/python3/dist-packages
ENV UNO_PYTHON_PATH=python3.7
ENV UNO_OFFICE_BINARY_PATH=/usr/lib/libreoffice/program/soffice.bin
RUN \
echo "UNO_PATH: ${UNO_PATH}" \
&& ls -l ${UNO_PATH} \
&& echo "UNO_PYTHON_PATH: ${UNO_PYTHON_PATH}" \
&& PYTHONPATH=${UNO_PATH} ${UNO_PYTHON_PATH} -c 'import uno, unohelper' \
&& echo "UNO_OFFICE_BINARY_PATH: ${UNO_OFFICE_BINARY_PATH}" \
&& ls -l ${UNO_OFFICE_BINARY_PATH}
# labels
LABEL org.opencontainers.image.source="https://github.com/elifesciences/sciencebeam-pipelines"
LABEL org.opencontainers.image.revision="${commit}"
LABEL org.opencontainers.image.version="${version}"