mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	move supervisord call into wrapper script
This commit is contained in:
		| @@ -125,6 +125,7 @@ COPY [ \ | |||||||
| 	"docker/supervisord.conf", \ | 	"docker/supervisord.conf", \ | ||||||
| 	"docker/docker-entrypoint.sh", \ | 	"docker/docker-entrypoint.sh", \ | ||||||
| 	"docker/docker-prepare.sh", \ | 	"docker/docker-prepare.sh", \ | ||||||
|  | 	"docker/paperless_cmd.sh", \ | ||||||
| 	"docker/wait-for-redis.py", \ | 	"docker/wait-for-redis.py", \ | ||||||
| 	"docker/management_script.sh", \ | 	"docker/management_script.sh", \ | ||||||
| 	"docker/install_management_commands.sh", \ | 	"docker/install_management_commands.sh", \ | ||||||
| @@ -144,6 +145,8 @@ RUN set -eux \ | |||||||
|     && chmod 755 /sbin/docker-prepare.sh \ |     && chmod 755 /sbin/docker-prepare.sh \ | ||||||
|     && mv wait-for-redis.py /sbin/wait-for-redis.py \ |     && mv wait-for-redis.py /sbin/wait-for-redis.py \ | ||||||
|     && chmod 755 /sbin/wait-for-redis.py \ |     && chmod 755 /sbin/wait-for-redis.py \ | ||||||
|  |     && mv paperless_cmd.sh /usr/local/bin/paperless_cmd.sh \ | ||||||
|  |     && chmod 755 /usr/local/bin/paperless_cmd.sh \ | ||||||
|   && echo "Installing managment commands" \ |   && echo "Installing managment commands" \ | ||||||
|     && chmod +x install_management_commands.sh \ |     && chmod +x install_management_commands.sh \ | ||||||
|     && ./install_management_commands.sh |     && ./install_management_commands.sh | ||||||
| @@ -222,4 +225,4 @@ ENTRYPOINT ["/sbin/docker-entrypoint.sh"] | |||||||
|  |  | ||||||
| EXPOSE 8000 | EXPOSE 8000 | ||||||
|  |  | ||||||
| CMD ["/usr/local/bin/supervisord", "-c", "/etc/supervisord.conf"] | CMD ["/usr/local/bin/paperless_cmd.sh"] | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								docker/paperless_cmd.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										15
									
								
								docker/paperless_cmd.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | #!/usr/bin/env bash | ||||||
|  |  | ||||||
|  | rootless_args=() | ||||||
|  | if [ $(id -u) == $(id -u paperless) ]; then | ||||||
|  | 	rootless_args=( | ||||||
|  | 		--user | ||||||
|  | 		paperless | ||||||
|  | 		--logfile | ||||||
|  | 		supervisord.log | ||||||
|  | 		--pidfile | ||||||
|  | 		supervisord.pid | ||||||
|  | 	) | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | /usr/local/bin/supervisord -c /etc/supervisord.conf ${rootless_args[@]} | ||||||
| @@ -186,8 +186,8 @@ Install Paperless from Docker Hub | |||||||
|  |  | ||||||
|     **Rootless** |     **Rootless** | ||||||
|  |  | ||||||
|     If you want to run Paperless as a rootless container, you will need to add the |     If you want to run Paperless as a rootless container, you will need to do the | ||||||
|     following to your ``docker-compose.yml``: |     following in your ``docker-compose.yml``: | ||||||
|  |  | ||||||
|     - set the ``user`` running the container to map to the ``paperless`` user in the |     - set the ``user`` running the container to map to the ``paperless`` user in the | ||||||
|       container. |       container. | ||||||
| @@ -195,26 +195,13 @@ Install Paperless from Docker Hub | |||||||
|       ``USERMAP_GID`` are set to in the next step. |       ``USERMAP_GID`` are set to in the next step. | ||||||
|       See ``USERMAP_UID`` and ``USERMAP_GID`` :ref:`here <configuration-docker>`. |       See ``USERMAP_UID`` and ``USERMAP_GID`` :ref:`here <configuration-docker>`. | ||||||
|  |  | ||||||
|     - override some of the ``supervisord`` defaults by setting the docker ``command`` |     Your entry for Paperless should contain something like: | ||||||
|       (`see here <https://docs.docker.com/compose/compose-file/#command>`_) to: |  | ||||||
|  |  | ||||||
|     Your ``docker-compose.yml`` entry for Paperless will look something like: |  | ||||||
|  |  | ||||||
|      .. code:: |      .. code:: | ||||||
|  |  | ||||||
|         webserver: |         webserver: | ||||||
|           image: ghcr.io/paperless-ngx/paperless-ngx:latest |           image: ghcr.io/paperless-ngx/paperless-ngx:latest | ||||||
|           user: <user_id> |           user: <user_id> | ||||||
|           command: |  | ||||||
|             - "/usr/local/bin/supervisord" |  | ||||||
|             - "-c" |  | ||||||
|             - "/etc/supervisord.conf" |  | ||||||
|             - "--user" |  | ||||||
|             - "paperless" |  | ||||||
|             - "--logfile" |  | ||||||
|             - "supervisord.log" |  | ||||||
|             - "--pidfile" |  | ||||||
|             - "supervisord.pid" |  | ||||||
|  |  | ||||||
| 5.  Modify ``docker-compose.env``, following the comments in the file. The | 5.  Modify ``docker-compose.env``, following the comments in the file. The | ||||||
|     most important change is to set ``USERMAP_UID`` and ``USERMAP_GID`` |     most important change is to set ``USERMAP_UID`` and ``USERMAP_GID`` | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Aidan Stein
					Aidan Stein