diff --git a/Dockerfile b/Dockerfile index 55d54cc01..fadea9a07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,10 +13,10 @@ ENV PAPERLESS_EXPORT_DIR=/export \ PAPERLESS_CONSUMPTION_DIR=/consume -RUN apk update --no-cache && apk add python3 gnupg libmagic bash shadow curl \ +RUN apk update --no-cache && apk add python3 gnupg libmagic libpq bash shadow curl \ sudo poppler tesseract-ocr imagemagick ghostscript unpaper optipng && \ apk add --virtual .build-dependencies \ - python3-dev poppler-dev gcc g++ musl-dev zlib-dev jpeg-dev && \ + python3-dev poppler-dev postgresql-dev gcc g++ musl-dev zlib-dev jpeg-dev && \ # Install python dependencies python3 -m ensurepip && \ rm -r /usr/lib/python*/ensurepip && \ diff --git a/requirements.txt b/requirements.txt index 92f4b0ff8..d30cbf078 100755 --- a/requirements.txt +++ b/requirements.txt @@ -43,6 +43,7 @@ pexpect==4.6.0 pickleshare==0.7.5 pillow==5.3.0 pluggy==0.8.0 +psycopg2==2.7.6.1 prompt-toolkit==2.0.7 ptyprocess==0.6.0 py==1.7.0 diff --git a/src/paperless/settings.py b/src/paperless/settings.py index 3583ca03a..d862837a1 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -152,6 +152,10 @@ def __get_boolean(key, default="NO"): } if os.getenv("PAPERLESS_DBPASS"): DATABASES["default"]["PASSWORD"] = os.getenv("PAPERLESS_DBPASS") + if os.getenv("PAPERLESS_DBHOST"): + DATABASES["default"]["HOST"] = os.getenv("PAPERLESS_DBHOST") + if os.getenv("PAPERLESS_DBPORT"): + DATABASES["default"]["PORT"] = os.getenv("PAPERLESS_DBPORT") # Password validation