mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	Merge pull request #564 from diveflo/feat/webserver/gunicorn
Gunicorn webserver in Docker
This commit is contained in:
		@@ -4,9 +4,10 @@ LABEL maintainer="The Paperless Project https://github.com/the-paperless-project
 | 
			
		||||
      contributors="Guy Addadi <addadi@gmail.com>, Pit Kleyersburg <pitkley@googlemail.com>, \
 | 
			
		||||
        Sven Fischer <git-dev@linux4tw.de>"
 | 
			
		||||
 | 
			
		||||
# Copy Pipfiles file and init script
 | 
			
		||||
# Copy Pipfiles file, init script and gunicorn.conf
 | 
			
		||||
COPY Pipfile* /usr/src/paperless/
 | 
			
		||||
COPY scripts/docker-entrypoint.sh /sbin/docker-entrypoint.sh
 | 
			
		||||
COPY scripts/gunicorn.conf /usr/src/paperless/
 | 
			
		||||
 | 
			
		||||
# Set export and consumption directories
 | 
			
		||||
ENV PAPERLESS_EXPORT_DIR=/export \
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ services:
 | 
			
		||||
        # value with nothing.
 | 
			
		||||
        environment:
 | 
			
		||||
            - PAPERLESS_OCR_LANGUAGES=
 | 
			
		||||
        command: ["runserver", "--insecure", "--noreload", "0.0.0.0:8000"]
 | 
			
		||||
        command: ["gunicorn", "-b", "0.0.0.0:8000"]
 | 
			
		||||
 | 
			
		||||
    consumer:
 | 
			
		||||
        build: ./
 | 
			
		||||
 
 | 
			
		||||
@@ -99,7 +99,13 @@ if [[ "$1" != "/"* ]]; then
 | 
			
		||||
        install_languages "$PAPERLESS_OCR_LANGUAGES"
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    exec sudo -HEu paperless "/usr/src/paperless/src/manage.py" "$@"
 | 
			
		||||
    if [[ "$1" = "gunicorn" ]]; then
 | 
			
		||||
        shift
 | 
			
		||||
        cd /usr/src/paperless/src/ && \
 | 
			
		||||
            exec sudo -HEu paperless /usr/bin/gunicorn -c /usr/src/paperless/gunicorn.conf "$@" paperless.wsgi
 | 
			
		||||
    else
 | 
			
		||||
        exec sudo -HEu paperless "/usr/src/paperless/src/manage.py" "$@"
 | 
			
		||||
    fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
exec "$@"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user