From dbc7d00f51031e8a227c8576d388b2b74a1dc702 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 6 May 2020 23:02:42 +0200 Subject: [PATCH] services: add PhotoPrism --- .gitignore | 1 + docker-compose.yml | 50 ++++++++++++++++++- .../proxy-confs/photoprism.subdomain.conf | 33 ++++++++++++ 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 letsencrypt/nginx/proxy-confs/photoprism.subdomain.conf diff --git a/.gitignore b/.gitignore index 6d867fb..d2992fb 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ embystat sabnzbd nzbhydra2 komga +photoprism /letsencrypt/* !/letsencrypt/nginx/ diff --git a/docker-compose.yml b/docker-compose.yml index 7dfc9ff..adfe855 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "2" +version: "3" services: letsencrypt: @@ -305,3 +305,51 @@ services: ports: - 8082:8080 user: 1000:1000 + + photoprism: + image: photoprism/photoprism:latest + container_name: photoprism + restart: unless-stopped + healthcheck: + test: "photoprism status" + interval: 60s + timeout: 15s + retries: 5 + environment: + PHOTOPRISM_URL: "https://photoprism.belanyi.fr" + PHOTOPRISM_TITLE: "PhotoPrism" + PHOTOPRISM_SUBTITLE: "Browse your life" + PHOTOPRISM_DESCRIPTION: "Personal Photo Management powered by Go and Google TensorFlow. Free and open-source." + PHOTOPRISM_AUTHOR: "Anonymous" + PHOTOPRISM_TWITTER: "@browseyourlife" + PHOTOPRISM_UPLOAD_NSFW: "true" + PHOTOPRISM_DETECT_NSFW: "true" + PHOTOPRISM_EXPERIMENTAL: "false" + PHOTOPRISM_DEBUG: "false" + PHOTOPRISM_READONLY: "false" + PHOTOPRISM_PUBLIC: "false" + PHOTOPRISM_DISABLE_SETTINGS: "false" + PHOTOPRISM_HTTP_HOST: "0.0.0.0" + PHOTOPRISM_HTTP_PORT: 2342 + PHOTOPRISM_TIDB_HOST: "0.0.0.0" + PHOTOPRISM_TIDB_PORT: 2343 # Port for built-in TiDB SQL server (driver "tidb") + PHOTOPRISM_TIDB_PASSWORD: "photoprism" # Plain text only (username "root") + PHOTOPRISM_ADMIN_PASSWORD: "$$2y$$10$$5/1WPeVMXk4SjBKyDdbqhuQU3RPiYyGZGl8yh0Fxa9eno6Ou/FbSi" # Plain text or bcrypt hash (escape "$" with "$$") + #PHOTOPRISM_WEBDAV_PASSWORD: "photoprism" # Plain text only (username "photoprism") + PHOTOPRISM_DATABASE_DRIVER: "tidb" # Change to "mysql" for external MySQL or MariaDB + PHOTOPRISM_DATABASE_DSN: "root:photoprism@tcp(localhost:2343)/photoprism?parseTime=true" + PHOTOPRISM_JPEG_QUALITY: 90 # Use 95 for high-quality thumbnails (requires more storage) + PHOTOPRISM_THUMB_FILTER: "lanczos" # Resample filter, best to worst: blackman, lanczos, cubic, linear + PHOTOPRISM_THUMB_UNCACHED: "false" # On-demand rendering of default thumbnails (high memory and cpu usage) + PHOTOPRISM_THUMB_SIZE: 2048 # Default thumbnail size limit (default 2048, min 720, max 3840) + PHOTOPRISM_THUMB_LIMIT: 3840 # On-demand thumbnail size limit (default 2048, min 720, max 3840) + volumes: + - ~/pictures/originals:/photoprism/originals + - ~/pictures/import:/photoprism/import + - ./photoprism/config:/photoprism/config + - ./photoprism/cache:/photoprism/cache + - ./photoprism/database:/photoprism/database + ports: + - 2342:2342 + - 2343:2343 + user: 1000:1000 diff --git a/letsencrypt/nginx/proxy-confs/photoprism.subdomain.conf b/letsencrypt/nginx/proxy-confs/photoprism.subdomain.conf new file mode 100644 index 0000000..d965d16 --- /dev/null +++ b/letsencrypt/nginx/proxy-confs/photoprism.subdomain.conf @@ -0,0 +1,33 @@ +# make sure that your dns has a cname set for adguard and that your adguard container is named adguard + +server { + listen 443 ssl; + listen [::]:443 ssl; + + server_name photoprism.*; + + include /config/nginx/ssl.conf; + + client_max_body_size 0; + + # enable for ldap auth, fill in ldap details in ldap.conf + #include /config/nginx/ldap.conf; + + location / { + # enable the next two lines for http auth + #auth_basic "Restricted"; + #auth_basic_user_file /config/nginx/.htpasswd; + + # enable the next two lines for ldap auth + #auth_request /auth; + #error_page 401 =200 /login; + + include /config/nginx/proxy.conf; + resolver 127.0.0.11 valid=30s; + set $upstream_app photoprism; + set $upstream_port 2342; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + + } +}