This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from pitkley/feature/dockerfile
Add Dockerfile for application and documentation
- Loading branch information
Showing
10 changed files
with
474 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FROM python:3.5.1 | ||
MAINTAINER Pit Kleyersburg <[email protected]> | ||
|
||
# Install dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
sudo \ | ||
tesseract-ocr tesseract-ocr-eng imagemagick ghostscript \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install python dependencies | ||
RUN mkdir -p /usr/src/paperless | ||
WORKDIR /usr/src/paperless | ||
COPY requirements.txt /usr/src/paperless/ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy application | ||
RUN mkdir -p /usr/src/paperless/src | ||
COPY src/ /usr/src/paperless/src/ | ||
|
||
# Set consumption directory | ||
ENV PAPERLESS_CONSUME /consume | ||
RUN mkdir -p $PAPERLESS_CONSUME | ||
|
||
# Migrate database | ||
WORKDIR /usr/src/paperless/src | ||
RUN mkdir /usr/src/paperless/data | ||
RUN ./manage.py migrate | ||
|
||
# Create user | ||
RUN groupadd -g 1000 paperless \ | ||
&& useradd -u 1000 -g 1000 -d /usr/src/paperless paperless \ | ||
&& chown -Rh paperless:paperless /usr/src/paperless | ||
|
||
# Setup entrypoint | ||
COPY scripts/docker-entrypoint.sh /sbin/docker-entrypoint.sh | ||
RUN chmod 755 /sbin/docker-entrypoint.sh | ||
|
||
# Mount volumes | ||
VOLUME ["/usr/src/paperless/data", "/usr/src/paperless/media", "/consume"] | ||
|
||
ENTRYPOINT ["/sbin/docker-entrypoint.sh"] | ||
CMD ["--help"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Environment variables to set for Paperless | ||
# Commented out variables will be replaced by a default within Paperless. | ||
|
||
# Passphrase Paperless uses to encrypt and decrypt your documents | ||
PAPERLESS_PASSPHRASE=CHANGE_ME | ||
|
||
# The amount of threads to use for text recognition | ||
# PAPERLESS_OCR_THREADS=4 | ||
|
||
# Additional languages to install for text recognition | ||
# PAPERLESS_OCR_LANGUAGES=deu ita | ||
|
||
# You can change the default user and group id to a custom one | ||
# USERMAP_UID=1000 | ||
# USERMAP_GID=1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
version: '2' | ||
|
||
services: | ||
webserver: | ||
image: paperless | ||
ports: | ||
# You can adapt the port you want Paperless to listen on by | ||
# modifying the part before the `:`. | ||
- "8000:8000" | ||
volumes: | ||
- paperless-data:/usr/src/paperless/data | ||
- paperless-media:/usr/src/paperless/media | ||
env_file: docker-compose.env | ||
environment: | ||
- PAPERLESS_OCR_LANGUAGES= | ||
command: ["runserver", "0.0.0.0:8000"] | ||
|
||
consumer: | ||
image: paperless | ||
volumes: | ||
- paperless-data:/usr/src/paperless/data | ||
- paperless-media:/usr/src/paperless/media | ||
# You have to adapt the local path you want the consumption | ||
# directory to mount to by modifying the part before the ':'. | ||
- /path/to/arbitrary/place:/consume | ||
env_file: docker-compose.env | ||
command: ["document_consumer"] | ||
|
||
volumes: | ||
paperless-data: | ||
paperless-media: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM python:3.5.1 | ||
MAINTAINER Pit Kleyersburg <[email protected]> | ||
|
||
# Install Sphinx and Pygments | ||
RUN pip install Sphinx Pygments | ||
|
||
# Setup directories, copy data | ||
RUN mkdir /build | ||
COPY . /build | ||
WORKDIR /build/docs | ||
|
||
# Build documentation | ||
RUN make html | ||
|
||
# Start webserver | ||
WORKDIR /build/docs/_build/html | ||
EXPOSE 8000/tcp | ||
CMD ["python3", "-m", "http.server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.