Direkt zum Hauptinhalt

Installation in Docker

Beschreibung:

Hier wird ein Docker container erzeiugt, das Volumes benötigt. Weil die ordner spezielle Benutzerrechte haben.

Installation

Vorrausetzung

Dockerinstallation

apt install docker.io docker-compose

Die Environment Datei

Hier werden Sprache Zeitzone und das Datenbank Passwort festgelegt werden

docker-compose.env

# The UID and GID of the user used to run paperless in the container.
#USERMAP_UID=1000
#USERMAP_GID=1000

# Additional languages to install for text recognition.
#PAPERLESS_OCR_LANGUAGES=tur ces

# Paperless-specific settings
#PAPERLESS_URL=https://paperless.example.com
#PAPERLESS_SECRET_KEY=change-me
#PAPERLESS_TIME_ZONE=America/Los_Angeles
#PAPERLESS_OCR_LANGUAGE=eng
#PAPERLESS_FORCE_SCRIPT_NAME=/PATHPREFIX
#PAPERLESS_STATIC_URL=/PATHPREFIX/static/

# Redis settings for Paperless
PAPERLESS_REDIS=redis://broker:6379

# Database configuration for MariaDB
MARIADB_HOST=paperless
MARIADB_DATABASE=paperless
MARIADB_USER=paperless
MARIADB_PASSWORD=paperless
MARIADB_ROOT_PASSWORD=paperless

# Paperless webserver environment settings
PAPERLESS_DBENGINE=mariadb
PAPERLESS_DBHOST=db
PAPERLESS_DBUSER=paperless
PAPERLESS_DBPASS=paperless
PAPERLESS_DBPORT=3306

Deutsch angepasste env Datei

# The UID and GID of the user used to run paperless in the container.
#USERMAP_UID=1000
#USERMAP_GID=1000

# Additional languages to install for text recognition.
PAPERLESS_OCR_LANGUAGES=gerdeu

# Paperless-specific settings
#PAPERLESS_URL=https://paperless.example.com
#PAPERLESS_SECRET_KEY=change-me
PAPERLESS_TIME_ZONE=Europe/Berlin
PAPERLESS_OCR_LANGUAGE=gerdeu
#PAPERLESS_FORCE_SCRIPT_NAME=/PATHPREFIX
#PAPERLESS_STATIC_URL=/PATHPREFIX/static/

# Redis settings for Paperless
PAPERLESS_REDIS=redis://broker:6379

# Database configuration for MariaDB
MARIADB_HOST=paperless
MARIADB_DATABASE=paperless
MARIADB_USER=paperless
MARIADB_PASSWORD=paperless
MARIADB_ROOT_PASSWORD=paperless

# Paperless webserver environment settings
PAPERLESS_DBENGINE=mariadb
PAPERLESS_DBHOST=db
PAPERLESS_DBUSER=paperless
PAPERLESS_DBPASS=paperless
PAPERLESS_DBPORT=3306

Die docker-compose Datei

version: "3.4"
services:
  broker:
    image: docker.io/library/redis:7
    restart: unless-stopped
    volumes:
      - redisdata:/data
    env_file: docker-compose.env

  db:
    image: docker.io/library/mariadb:10
    restart: unless-stopped
    volumes:
      - dbdata:/var/lib/mysql
    env_file: docker-compose.env

  webserver:
    image: ghcr.io/paperless-ngx/paperless-ngx:latest
    restart: unless-stopped
    depends_on:
      - db
      - broker
    ports:
      - "8000:8000"
    volumes:
      - data:/usr/src/paperless/data
      - media:/usr/src/paperless/media
      - ./export:/usr/src/paperless/export
      - ./consume:/usr/src/paperless/consume
    env_file: docker-compose.env

volumes:
  data:
  media:
  dbdata:
  redisdata:

Nun das Shell script für die SSl cert und die nginx conf

nano create_ssl_cert.sh

Inhalt:

#!/bin/bash

# Directory for SSL certificates
mkdir -p ./cert

# Generate SSL certificates
openssl req -x509 -nodes -days 36500 -newkey rsa:2048 -keyout ./cert/server.key -out ./cert/server.crt -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=yourdomain.com"

echo "SSL certificates generated and stored in ./cert directory."

Nun das shell script ausführbar machen

chmod + create_ssl_cert.sh

Dann ausführen

./create_ssl_cert.sh 

Nun die nginx.conf erstellen

nano nginx.conf

Inhalt

worker_processes 1;

events {
    worker_connections 1024;
}

http {
    sendfile on;

    server {
        listen 443 ssl;
        server_name yourdomain.com;

        ssl_certificate /etc/nginx/cert/server.crt;
        ssl_certificate_key /etc/nginx/cert/server.key;

        location / {
            proxy_pass http://webserver:8000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
}

 

nun mit

docker-compose up -d

den kram starten

Danach kann über Port https://ip

Paperless aufgerufen werden

Screenshot 2024-04-27 at 22-18-41 Paperless-ngx Anmeldung.png

Anmelden