Looking for Paperless Docker howto

Post Reply
tanderson92
New here
Posts: 9
Joined: Sun Jul 26, 2020 2:18 pm

Looking for Paperless Docker howto

Post by tanderson92 » Sun Jul 26, 2020 3:14 pm

I've recently upgraded my old Thecus NAS to a TVS-673 and am looking to learn how to use Docker containers. I jumped right in with QNAP Container Station, but I'm dead in the water. Here's my progress so far:

1. Installed Container Station
2. Searched for "paperless" and chose the official Docker project here: https://hub.docker.com/r/thepaperlessproject/paperless
3. Selected Install, but I don't know what options to pick for creating the container.
4. After unsuccessfully looking for what options to change, I created the container with the default options.

This resulted in a "paperless-1" container that will run for a few seconds and stop. This seems to be because the Container Station auto filled my empty "command" line with "--help." Therefore it's running paperless --help which displays some text and then quits. The official setup instructions here: https://paperless.readthedocs.io/en/lat ... ker-method are based on the command line for a Linux distro, and I have no idea how to translate this to Container Station commands, whether I need to create a special user for this container, etc. I'm reading through https://www.qnap.com/en/how-to/tutorial ... r-station/, and I think the issue is that instead of a blank command line I should be including something in the command area such as ./run.sh, php -a, etc (from the examples they gave) and not just "--help."

Can someone help me how to figure out this Docker install?

User avatar
spikemixture
Been there, done that
Posts: 847
Joined: Wed Mar 07, 2018 11:04 pm
Location: 3rd World

Re: Looking for Paperless Docker howto

Post by spikemixture » Sun Jul 26, 2020 3:26 pm

I'll be watching member's suggestions.

Docker on Qnap is a steep learning curve.
Qnap TS-1277 1700 (48gb RAM) 6x8TB WD White, 2x8TB WD Red - Raid5, 2x M.2 Crucial 1TB (Raid 1 VM),
2x SSD 860 EVO 500gb (Raid1 QTS), 2x SSD 860 EVO 250GB (Cache), 2x M.2 PCIe 970 500gb NVME (Raid1 Plex and Emby server)
GTX 1050 TI
Qnap TVS-1282 i7 (32GB RAM) 8x10TB WD White - Raid 6, 2x M.2 Crucial 500gb (Raid1 VM),
2x SSD EVO 500gb (Raid1 QTS), 2x SSD EVO 250gb (Raid1 Cache), 2x M.2 PCIe Intel 512GB NVME (Raid1-Servers)
Synology -1817+ - 2x10,2x8,2x6 (Ironwolf) 2x6 (WD Red) - SHR
Drobo 5n - 3x2TB WD Green, 2x3TB WD Red - Drobo Raid
ProBox 8 Bay USB3 - 8x4TB Seagate - JBOD
All software is updated asap.
I give my opinion from my experience i.e. I have (or had) that piece of equipment/software and used it! :roll:

tanderson92
New here
Posts: 9
Joined: Sun Jul 26, 2020 2:18 pm

Re: Looking for Paperless Docker howto

Post by tanderson92 » Sun Jul 26, 2020 3:43 pm

Quick update: from the documentation, it looks like "document_consumer" is the command I should be running. So I created a new container using the official Docker project as before, only this time I used document_consumer. I now seem to have a running container, but it's still not right since there's no web server and no way to access the paperless system. I'm wondering if modifying the environment variables in the advanced settings would be the same as modifying the docker-compose.env in the setup instructions. I'll keep poking around and report back if I figure out more.

EDIT: It looks like document_consumer is a script to listen for files to consume, which is why I don't have a webserver, etc. On the Paperless GitHub issues page, it's recommended that Paperless probably can't be installed via the container station. I think it probably can be installed from the container station, but the problem is knowing how to translate the CLI instructions to appropriate Container Station settings. For example, as far as I can tell the Container Station's Environment setting can replace docker-compose.env.

I've also found the add an application command which looks like I can possibly paste the modified text of docker-compose.yml in order to download everything and create the app. Unlike the Docker Hub package, it looks like I'll have to manually update all the paths. For example, the Docker Hub install automatically created /consume at /share/CACHEDEV1_DATA/Container/container-station-data/lib/docker/volumes/08f6481d4faf53f8f5f2532a0fffc662b48f03bb5d19c8a994aeb660cee65ba4/_data, and the other required folders in similar fashion. I'm wondering if I can use these paths in the .yml file. I'll keep poking around.

tanderson92
New here
Posts: 9
Joined: Sun Jul 26, 2020 2:18 pm

Re: Looking for Paperless Docker howto

Post by tanderson92 » Sun Jul 26, 2020 4:48 pm

Ok, getting a little further here thanks to some help from the Synology users who've set it up. It looks like two containers need to be setup from the same Docker Hub image. One will run the command "document_consumer" to listen for and process documents. The other uses "runserver" and should run the required webserver. Here's the tail of the console after running the server:

Code: Select all

System check identified no issues (0 silenced).                                                                                             
July 26, 2020 - 08:17:00                                                                                                                    
Django version 2.0.13, using settings 'paperless.settings'                                                                                  
Starting development server at http://127.0.0.1:8000/                                                                                       
Quit the server with CONTROL-C.  
This makes it look like the server is running, but from my desktop I can't connect to [QNAP IP]:8000. I tried setting the network to both NAT and Host, and neither one allows me to connect to the server. I feel like I'm getting close and will probably keep trying to see if I can figure this out today.

tanderson92
New here
Posts: 9
Joined: Sun Jul 26, 2020 2:18 pm

Re: Looking for Paperless Docker howto

Post by tanderson92 » Mon Jul 27, 2020 12:34 am

I gave up and installed from the command line. Just in case it helps anyone, here's what I did:

made a directory /share/CACHEDEV1_DATA/.qpkg/paperless/ (for program and data) and a shared folder /share/paperless (for consume directory accessible by all home computers)

Code: Select all

ln -s /share/CACHEDEV1_DATA/.qpkg/paperless /opt/paperless (since other apps seem to have symlinks in /opt)
cd /opt/paperless
wget https://github.com/the-paperless-project/paperless/archive/master.zip
unzip master.zip
cd paperless-master
Here I noticed the zip didn't contain the docker-compose.yml.example file seen on github. I manually opened that file at https://github.com/the-paperless-projec ... ml.example and copied the contents. I used my sftp program (Filezilla) to connect to the share and navigated to /opt/paperless/paperless-master. I used Filezilla to create a file docker-compose.yml and edited it with my local editor. I pasted in the contents of docker-compose.yml.example, removed references to docker-compose.env, and edited the consume path to /share/paperless/consume:/consume. I saved this file in my local editor, and Filezilla offered to update it on the server. At this point I went back to my ssh window and entered

Code: Select all

docker-compose up -d
A lot of text went by as it downloaded and installed packages. I saw a few errors, but they went by too quickly for me to note the specifics. At the end I had a running webserver and was able to connect to [QNAP NAS IP]:8000 from my desktop. To enable a paperless superuser, I typed

Code: Select all

docker-compose run --rm webserver createsuperuser
and created the default user named paperless.

I now have a working installation of Paperless that I've tested with a few sample documents. Inside Container Station I see an app with two separate containers, one for the server and one for consume. Because they were created outside of CS, it won't let me see the settings. Someone smarter than I can probably find the settings used and recreate the steps in CS instead of having to use the command line at all.

User avatar
oyvindo
Experience counts
Posts: 1153
Joined: Tue May 19, 2009 2:08 am
Location: Norway, Oslo

Re: Looking for Paperless Docker howto

Post by oyvindo » Mon Jul 27, 2020 6:09 am

Just curious; What do you get from "Paperless" that QSirch cannot already do for you?
ImageImageImageImage

tanderson92
New here
Posts: 9
Joined: Sun Jul 26, 2020 2:18 pm

Re: Looking for Paperless Docker howto

Post by tanderson92 » Mon Jul 27, 2020 11:29 am

oyvindo wrote:
Mon Jul 27, 2020 6:09 am
Just curious; What do you get from "Paperless" that QSirch cannot already do for you?
I don't know. Haven't looked into QSirch. If Paperless doesn't pan out, I'll give it a try. Before I start scanning everything I eventually want to index digitally, I've been dumping hundreds of PDFs already stored around my computer. I'm taking it slowly and trying to index each file as I pass it to Paperless. It allows a filename such as Date - Correspondent - Title of document - tag1,tag2,tag3. Then when it's processed, I see file "Title of document" in Paperless with the date and correspondent identified, as well as any tags. I have many groups of files that can be batch name changed to speed up the process a bit, but it's going to take awhile. Theoretically when we're caught up, all new documents we need to save will be scanned as we receive them and filed directly in Paperless. We'll see.

User avatar
oyvindo
Experience counts
Posts: 1153
Joined: Tue May 19, 2009 2:08 am
Location: Norway, Oslo

Re: Looking for Paperless Docker howto

Post by oyvindo » Mon Jul 27, 2020 2:03 pm

QSirch is just like Google, but local. You type something and it gives you an organised list of every kind of file matching what you typed. It's not limited to PDF files. It can be any kind of file. And it can be stored anywhere on your NAS (or group of NAS's). Indexing takes place in real-time in the background. It even integrates with Google Chrome so that when you search for something on the internet, it will simultaneously let you know if there's something locally that matches your search.
ImageImageImageImage

tanderson92
New here
Posts: 9
Joined: Sun Jul 26, 2020 2:18 pm

Re: Looking for Paperless Docker howto

Post by tanderson92 » Tue Jul 28, 2020 10:30 am

oyvindo wrote:
Mon Jul 27, 2020 2:03 pm
QSirch is just like Google, but local. You type something and it gives you an organised list of every kind of file matching what you typed. It's not limited to PDF files. It can be any kind of file. And it can be stored anywhere on your NAS (or group of NAS's). Indexing takes place in real-time in the background. It even integrates with Google Chrome so that when you search for something on the internet, it will simultaneously let you know if there's something locally that matches your search.
It sounds interesting. Does it have built-in OCR and deskewing? Paperless uses Tesseract for OCR and another open source program I can't remember to auto deskew documents.

User avatar
oyvindo
Experience counts
Posts: 1153
Joined: Tue May 19, 2009 2:08 am
Location: Norway, Oslo

Re: Looking for Paperless Docker howto

Post by oyvindo » Tue Jul 28, 2020 1:43 pm

No, id does not have OCR and deskewing.
ImageImageImageImage

EmileQ
Starting out
Posts: 13
Joined: Mon Oct 25, 2010 6:25 pm

Re: Looking for Paperless Docker howto

Post by EmileQ » Thu Oct 08, 2020 1:43 pm

tanderson92 wrote:
Mon Jul 27, 2020 12:34 am
I gave up and installed from the command line. Just in case it helps anyone, here's what I did:

made a directory /share/CACHEDEV1_DATA/.qpkg/paperless/ (for program and data) and a shared folder /share/paperless (for consume directory accessible by all home computers)
...
@tanderson92 Thanks for your tutorial! I finally get it working on my Qnap as well... however there is a little problem.
The only question I have is how you managed to create the directory and the shared folder. Did you create the directory and the shared folder from command line? I did it from command line, but my shared folder isn't visible in the File Station on the Qnap (I already did chmod / chown on the folder). Then I tried it the other way, first create the shared folder from GUI in the control panel of the Qnap. But then the creation of the docker fails because it cannot access the shared folder. So it looks like a "chicken-egg" story, can you point me in the right direction please?

BTW I looked at Qsirch as an alternative, but that's a real search machine and NOT a DMS like Paperless
TS-453Pro

Post Reply

Return to “Container Station”