forked from linuxserver/docker-papermerge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
86 lines (79 loc) · 2.09 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
FROM ghcr.io/linuxserver/baseimage-ubuntu:focal
# set version label
ARG BUILD_DATE
ARG VERSION
ARG PAPERMERGE_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="alex-phillips"
# ensures our console output looks familiar and is not buffered by Docker
ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE config.settings.production
# NOTE: the additional lib and python dependencies are for the ARM builds
ARG BUILD_PACKAGES="\
apache2-dev \
build-essential \
git \
libffi-dev \
libpq-dev \
libmariadbclient-dev \
libxml2-dev \
libxslt-dev \
python3-dev \
python3-pip"
# packages as variables
ARG RUNTIME_PACKAGES="\
imagemagick \
libmariadb3 \
libpq5 \
libxslt1.1 \
poppler-utils \
python3 \
python3-cryptography \
python3-distutils \
python3-mysqldb \
python3-psycopg2 \
python3-setuptools \
redis \
tesseract-ocr \
tesseract-ocr-eng \
uwsgi \
uwsgi-plugin-python3"
RUN \
apt-get update && \
echo "**** install build packages ****" && \
apt-get install -y \
--no-install-recommends \
$BUILD_PACKAGES && \
echo "**** install runtime packages ****" && \
apt-get install -y \
--no-install-recommends \
$RUNTIME_PACKAGES && \
echo "**** install papermerge ****" && \
mkdir -p /app/papermerge && \
if [ -z ${PAPERMERGE_RELEASE+x} ]; then \
PAPERMERGE_RELEASE=$(curl -sX GET "https://api.github.com/repos/ciur/papermerge/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/papermerge.tar.gz -L \
"https://github.com/ciur/papermerge/archive/${PAPERMERGE_RELEASE}.tar.gz" && \
tar xf \
/tmp/papermerge.tar.gz -C \
/app/papermerge/ --strip-components=1 && \
echo "**** install pip packages ****" && \
cd /app/papermerge && \
pip3 install django==3.1.7 && \
/bin/bash -c 'shopt -s globstar && \
for f in ./requirements/**/*; do pip3 install -r $f; done && \
shopt -u globstar' && \
echo "**** cleanup ****" && \
apt-get purge -y --auto-remove \
$BUILD_PACKAGES && \
rm -rf \
/root/.cache \
/tmp/* && \
apt-get clean -y
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 8000