mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	Simplify instructions for exporting with docker
The export workflow reusing the `/consume` volume is complex and error- prone, and not at all necessary if the `docker-compose.yml` file has a volume for `/export` from the beginning.
This commit is contained in:
		
							parent
							
								
									ec88ea73f6
								
							
						
					
					
						commit
						147f8f72a2
					
				@ -23,6 +23,12 @@ services:
 | 
			
		||||
            # 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
 | 
			
		||||
            # Likewise, you can add a local path to mount a directory for
 | 
			
		||||
            # exporting. This is not strictly needed for paperless to
 | 
			
		||||
            # function, only if you're exporting your files: uncomment
 | 
			
		||||
            # it and fill in a local path if you know you're going to 
 | 
			
		||||
            # want to export your documents.
 | 
			
		||||
            # - /path/to/another/arbitrary/place:/export
 | 
			
		||||
        env_file: docker-compose.env
 | 
			
		||||
        command: ["document_consumer"]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -74,40 +74,20 @@ as JSON is almost as easy:
 | 
			
		||||
 | 
			
		||||
    $ docker-compose run --rm webserver dumpdata documents.Tag > /path/to/arbitrary/place/tags.json
 | 
			
		||||
 | 
			
		||||
Exporting the documents though is a little more involved, since docker-compose
 | 
			
		||||
doesn't support mounting additional volumes with the ``run`` command. You have
 | 
			
		||||
three general options:
 | 
			
		||||
To export the documents you can either use ``docker run`` directly, specifying all
 | 
			
		||||
the commandline options by hand, or (more simply) mount a second volume for export.
 | 
			
		||||
 | 
			
		||||
1. Use the consumption directory if you happen to already have it mounted to a
 | 
			
		||||
   host directory.
 | 
			
		||||
To mount a volume for exports, follow the instructions in the
 | 
			
		||||
``docker-compose.yml.example`` file for the ``/export`` volume (making the changes
 | 
			
		||||
in your own ``docker-compose.yml`` file, of course). Once you have the
 | 
			
		||||
volume mounted, the command to run an export is:
 | 
			
		||||
 | 
			
		||||
.. code-block:: console
 | 
			
		||||
 | 
			
		||||
       $ # Stop the consumer so that it doesn't consume the exported documents
 | 
			
		||||
       $ docker-compose stop consumer
 | 
			
		||||
       $ # Export into the consumption directory
 | 
			
		||||
       $ docker-compose run --rm consumer document_exporter /consume
 | 
			
		||||
 | 
			
		||||
2. Add another volume to ``docker-compose.yml`` for exports and use
 | 
			
		||||
   ``docker-compose run``:
 | 
			
		||||
 | 
			
		||||
   .. code-block:: diff
 | 
			
		||||
 | 
			
		||||
      diff --git a/docker-compose.yml b/docker-compose.yml
 | 
			
		||||
      --- a/docker-compose.yml
 | 
			
		||||
      +++ b/docker-compose.yml
 | 
			
		||||
      @@ -17,9 +18,8 @@ services:
 | 
			
		||||
               volumes:
 | 
			
		||||
                   - paperless-data:/usr/src/paperless/data
 | 
			
		||||
                   - paperless-media:/usr/src/paperless/media
 | 
			
		||||
                   - /consume
 | 
			
		||||
      +            - /path/to/arbitrary/place:/export
 | 
			
		||||
 | 
			
		||||
   .. code-block:: shell-session
 | 
			
		||||
 | 
			
		||||
   $ docker-compose run --rm consumer document_exporter /export
 | 
			
		||||
 | 
			
		||||
3. Use ``docker run`` directly, supplying the necessary commandline options:
 | 
			
		||||
If you prefer to use ``docker run`` directly, supplying the necessary commandline
 | 
			
		||||
options:
 | 
			
		||||
 | 
			
		||||
.. code-block:: shell-session
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user