added dependency on network.target so that paperless-webserver can cleanly shutdown before the network goes down (during reboots, etc.)
network-online.target is not required when accessing paperless on localhost, so having a dependency on it is not necessary.
Need to allow non-unique group ids, so paperless can map to an existing GID.
The comment says the map_uidgid() function came from docker-gitlab, the same fix was applied there too:
c80bd87662
Thanks to @MasterofJOKers, here is basic support for SSL:
You need to create your key and certificate and copy them to the `data`
directory, named `ssl.cert` and `ssl.key`.
Then, set `PAPERLESS_USE_SSL` in `docker-compose.env` to `true`.
Solves #576.
* Vagrant does not seem to have any libvirt boxes for Ubuntu any more.
* Vagrant 2 was released a year ago, but vagrant-libvirt only claims
to support up to Vagrant 1.8.
This commit fixes a nasty bug, where the docker-entrypoint.sh silently
exits without any error message. The test for a lock file can fail and
due to the `set -e` at the beginning of the file the bash script exists
without starting the paperless application.
It is fixed by moving the check for the existence of the lock file into
the if statement, where the `set -e` does not trigger an exit in case
the statement fails.
Additionally this commit enables the script to trap exit signals and in
that case deletes the lock file.
issues found by shellcheck were:
```
$ shellcheck docker-entrypoint.sh
In docker-entrypoint.sh line 10:
if [[ ${USERMAP_UID} != ${USERMAP_ORIG_UID} || ${USERMAP_GID} != ${USERMAP_ORIG_GID} ]]; then
^-- SC2053: Quote the rhs of != in [[ ]] to prevent glob matching.
^-- SC2053: Quote the rhs of != in [[ ]] to prevent glob matching.
In docker-entrypoint.sh line 12:
groupmod -g ${USERMAP_GID} paperless
^-- SC2086: Double quote to prevent globbing and word splitting.
In docker-entrypoint.sh line 65:
if dpkg -s "$pkg" 2>&1 > /dev/null; then
^-- SC2069: The order of the 2>&1 and the redirect matters. The 2>&1 has to be last.
In docker-entrypoint.sh line 69:
if ! apt-cache show "$pkg" 2>&1 > /dev/null; then
^-- SC2069: The order of the 2>&1 and the redirect matters. The 2>&1 has to be last.
```
Changing the group or permissions on the consumption directory can fail,
especially on network-mounted directories. If it fails, don't exit the
consumer, but rather output a warning on what the user has to do.
This is related to (and should close) issue #102.
This commit adds a `Dockerfile` to the root of the project, accompanied
by a `docker-compose.yml.example` for simplified deployment. The
`Dockerfile` is agnostic to whether it will be the webserver, the
consumer, or if it is run for a one-off command (i.e. creation of a
superuser, migration of the database, document export, ...).
The containers entrypoint is the `scripts/docker-entrypoint.sh` script.
This script verifies that the required permissions are set, remaps the
default users and/or groups id if required and installs additional
languages if the user wishes to.
After initialization, it analyzes the command the user supplied:
- If the command starts with a slash, it is expected that the user
wants to execute a binary file and the command will be executed
without further intervention. (Using `exec` to effectively replace
the started shell-script and not have any reaping-issues.)
- If the command does not start with a slash, the command will be
passed directly to the `manage.py` script without further
modification. (Again using `exec`.)
The default command is set to `--help`.
If the user wants to execute a command that is not meant for `manage.py`
but doesn't start with a slash, the Docker `--entrypoint` parameter can
be used to circumvent the mechanics of `docker-entrypoint.sh`.
Further information can be found in `docs/setup.rst` and in
`docs/migrating.rst`.
For additional convenience, a `Dockerfile` has been added to the `docs/`
directory which allows for easy building and serving of the
documentation. This is documented in `docs/requirements.rst`.