mirror of
https://github.com/ciur/papermerge.git
synced 2026-04-25 12:05:58 +03:00
[GH-ISSUE #80] Docker Image Set GID an UID with environment variables #62
Labels
No labels
2.1
3.0
3.0.1
3.0.2
3.0.3
3.0.3
3.1
3.2
3.2
3.3
3.5
3.x
Fixed. Waiting for feedback.
Fixed. Waiting for feedback.
UX
Version 2.1 - alpha
XSS
announcement
beta
blocker
bug
cannot reproduce
confirmed
confirmed
critical
demo
dependencies
deployment
detchnical debt
discussion
docker
documentation
donations
duplicate
enhancement
feature request
frontend
fundraising
good first issue
good issue
help wanted
high
implemented
important
improvement
incomplete
invalid
investigation
kubernetes
low
low impact
medium
medium
medium impact
migration from 2.0
migration from 2.1
missing-language
missing-ocr-language
no-activity
note
ocr
outofscope
packaging
performance
popular request
pull-request
pypi
question
raspberry pi
roadmap
search
security
setup
status
task
technical debt
updates
user xp
version 1.4.0 - demo
will be implemented
will not be implemented
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/papermerge#62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Philap95 on GitHub (Aug 19, 2020).
Original GitHub issue: https://github.com/ciur/papermerge/issues/80
Hi,
im using a Synology Nas (DS218+) and want to run the docker container, but every time i get issues with the file permissions between the container and host filesystem, yeah setting rights to public on the Nas should make it work, but for private documents thats not an option, so it would great to be able to set the Gid and Uid in the environment variables of the container.
Maybe this could help https://vsupalov.com/docker-shared-permissions/
@Tooa commented on GitHub (Aug 23, 2020):
Recently,
Linuxserverreleased a Papermerge Docker build withPGIDandPUIDsupport here.@Philap95 commented on GitHub (Aug 23, 2020):
Hello @Tooa , that's good news for me, sounds very good, thanks for your reply, i will set it up now and test it, thanks a lot 😊
@okoetter commented on GitHub (Sep 16, 2020):
I am using
Linuxserver's docker image and it's way easier to setup on my Synology NAS than the original docker files. But does anybody know how to use the worker to monitor a directory with scans with it?@ciur commented on GitHub (Sep 17, 2020):
Hi @okoetter!
The setting you are looking for is IMPORTER_DIR. You need to change it only on worker side/container.
The thing is, I don't run Papermerge via Docker on the daily basis, so it is very difficult for me to advice you how to correctly play nicely with docker images.
I assume you need somehow to map your local/network folder to same point IMPORTER_DIR is pointing to within docker image.
I updated documentation with how to apply changes in Docker Container.
Maybe there are docker experts in this thread who can help you (and me!) in regards of docker image. Given such useful info, I will gladly update documentation.
@okoetter commented on GitHub (Sep 17, 2020):
Hi @ciur,
thanks for your answer.
No, I do not need help how to map my local folder to the docker image. And the use of
IMPORTER_DIRis also clear. What I don't understand is how I get the second container (worker container. I don't use the third db container as I want to use sqlite). I only have the main app container.I cannot use your docker files as
docker-compose updoes not build correctly on my Synology NAS. When I am asked for the region and I enter 8 for Europe nothing happens.So I chose
Linuxserver's docker image as I made some good experiences with his images. But that is only the main app container and I also need a worker container to import from my scans folder, correct? Or can I do both in one container?@sizzicus commented on GitHub (Sep 17, 2020):
@okoetter
I figured this out for myself last night:
If you're using the linuxserver.io image you can set the IMPORTER_DIR setting in papermerge.conf.py in the image's /config directory. Then it seems to work fine. Not an ideal solution, but the linuxserver image only allows a few env variables passed in.
Maybe it would also work to maintain your own papermerge.conf.py and pass it into the linuxserver image with bind mount.
@okoetter commented on GitHub (Sep 18, 2020):
@sizzicus
Thanks for the info. I will create a "/scan" directory inside the container, point IMPORTER_DIR to that and map that folder within Docker to the real external dir.
But does the one linuxserver.io image also provide periodically calling the worker app to check the import folder for new scans?
I thought there was a second container needed for that.
@sizzicus commented on GitHub (Sep 19, 2020):
The auto importing definitely works correctly once you tell it where to look, so they must have correctly integrated all three parts of this app. (linuxserver.io is all about making single integrated images that all work on the same base image and setup rules)
@okoetter commented on GitHub (Sep 20, 2020):
OK, I can't get it to work.
This is what I've done:
docker exec -it linuxserver-papermerge1 /bin/bashand create/importfolder/volume1/scanto docker container's/import/importbyls -l /importcat /config/papermerge.conf.py:IMPORTER_DIR = "/import/"
but my pdfs never show up in Papermerge. What am I doing wrong?
@sizzicus commented on GitHub (Sep 21, 2020):
Hi,
I didn't need to enter the running container to make this work.
-
-
-
MEDIA_DIR = "/data/media" STATIC_DIR = "/app/papermerge/static" MEDIA_URL = "/media/" STATIC_URL = "/static/" IMPORTER_DIR = "/import/"I have the container's /config directory mapped out to a volume called docs_config. This should work for a direct path mount also.
After starting up the container for the first time, it generates papermerge.conf.py in that volume.
I stopped/removed the container (docker-compose down) and then edited that file from the host system to add an importer_dir entry below the rest of the path settings:
(you do not have to create the /import directory inside the running container)
papermerge | [2020-09-21 00:41:16,744: INFO/ForkPoolWorker-2] Importing file /import/dummy.pdf...
papermerge | [2020-09-21 00:41:16,749: INFO/ForkPoolWorker-2] Same as temp_file_name=/tmp/tmp3u7a2292/dummy.pdf...
papermerge | [2020-09-21 00:41:16,754: DEBUG/ForkPoolWorker-2] Importing file /tmp/tmp3u7a2292/dummy.pdf.
papermerge | [2020-09-21 00:41:16,964: DEBUG/ForkPoolWorker-2] Post save doc => normalize_pages
papermerge | [2020-09-21 00:41:16,968: DEBUG/ForkPoolWorker-2] Normalizing document 12
etc...
I hope this helps!
@okoetter commented on GitHub (Sep 21, 2020):
I got it working now, thanks for your help. It was a permissions problem with my scan share on my NAS.
To get German OCR working in
Linuxserver's image I had to bash into the container andapt updateapt install tesseract-ocr-deuto install the German tesseract packageHope that helps others.