July 9, 20241 yr I'm using paperless-ngx docker, I need to install a few more pip packages for a post processing script I'm creating (Using ChatGPT to get me the costs in bills and receipts and add it as a field to each document). I tried to write - -it paperless-ngx sh -c 'pip install PyPDF2 openai' In the Extra Parameters field, and it failed so badly, it messed up the installation, I had to reinstall the docker... (and re-set all the parameters and variables, a big headache). What should be the trick to do that? What am I missing?
July 9, 20241 yr Author Replying to myself here for a minute, I made some progress but still no success - I wrote - --entrypoint /usr/src/paperless/scripts/startup.sh in the "Extra Parameters" And startup.sh is #!/bin/sh pip install PyPDF2 openai /usr/sbin/docker-entrypoint.sh But /usr/sbin/docker-entrypoint.sh is probably not the right entrypoint, or I'm missing something obvious here, because the docker doesn't load. Any assistance will be highly appreciated. I get the error: /usr/sbin/docker-entrypoint.sh: line 162: $1: unbound variable I then modified startup.sh to be: #!/bin/sh pip install PyPDF2 openai /usr/sbin/docker-entrypoint.sh "$@" And now I don't see any issues in the log, it just stops and doesn't continue. The log now ends with: Installing collected packages: PyPDF2, pydantic-core, distro, annotated-types, pydantic, openai Successfully installed PyPDF2-3.0.1 annotated-types-0.7.0 distro-1.9.0 openai-1.35.10 pydantic-2.8.2 pydantic-core-2.20.1 Paperless-ngx docker container starting... Mapping UID and GID for paperless:paperless to 99:100 Creating directory scratch directory /tmp/paperless Adjusting permissions of paperless files. This may take a while. Waiting for Redis... Connected to Redis broker. Apply database migrations... Operations to perform: Apply all migrations: account, admin, auditlog, auth, authtoken, contenttypes, django_celery_results, documents, guardian, paperless, paperless_mail, sessions, socialaccount Running migrations: No migrations to apply. Running Django checks System check identified no issues (0 silenced). Edited July 9, 20241 yr by DrMor
July 9, 20241 yr Author Solution For anyone looking to do the same, I solved it. startup.sh needs to be: #!/bin/sh # Install necessary Python packages pip install PyPDF2 openai # Default command if none is provided if [ -z "$1" ]; then set -- "/usr/local/bin/paperless_cmd.sh" fi # Execute the original entry point script with provided arguments exec /sbin/docker-entrypoint.sh "$@" and "Extra Parameters" is: --entrypoint /usr/src/paperless/scripts/startup.sh Important to not forget "chmod +x startup.sh" and the proper path allocation in unraid, in my case from "/mnt/cache/appdata/paperless-ngx/scripts/" to "/usr/src/paperless/scripts"
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.