User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
services:photoview [2024/08/08 12:11] willyservices:photoview [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== PhotoView ====== 
- 
-[[https://photoview.github.io|PhotoView]] is a photos gallery written by a photographer for photographers.  
- 
-===== Installation ===== 
- 
-Create user: 
- 
-<code bash> 
-useradd -d /data/daemons/pigallery2 -m -g photos pigallery2 
-</code> 
- 
-Create the **docker-compose.yml**: 
-<file - docker-compose.yml> 
-services: 
-  photoview: 
-    image: viktorstrate/photoview:2 
-    hostname: photoview 
-    container_name: photoview 
-    ports: 
-      - "8009:1808"  
-    depends_on: 
-      mariadb: 
-    environment: 
-      PHOTOVIEW_DATABASE_DRIVER: mysql 
-      ## Comment out the next variable in the case PHOTOVIEW_DATABASE_DRIVER is set to `sqlite` or `postgres` in the .env 
-      PHOTOVIEW_MYSQL_URL: "photoview:<< your random db password here >>@tcp(photoview-mariadb)/photoview" 
-      PHOTOVIEW_LISTEN_IP: "photoview" 
-      MAPBOX_TOKEN: "<< generate MapBox Token and put it here >>" 
-      PHOTOVIEW_LISTEN_PORT: 1808 
-    volumes: 
-      - "/etc/localtime:/etc/localtime:ro"  
-      - "/etc/timezone:/etc/timezone:ro"    
-      - "/data/daemons/photoview/storage:/home/photoview/media-cache" 
-      - "/data/Photos:/photos:ro" #  here put your photos path! 
-    networks: 
-      - photoview-net 
- 
-  mariadb: 
-    networks:  
-      - photoview-net 
-    image: mariadb:lts 
-    hostname: photoview-mariadb 
-    container_name: photoview-mariadb 
-    restart: unless-stopped 
-    stop_grace_period: 5s 
-    command: mariadbd --innodb-buffer-pool-size=512M --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=120 
-    security_opt: ## see https://github.com/MariaDB/mariadb-docker/issues/434#issuecomment-1136151239 
-      - seccomp:unconfined 
-      - apparmor:unconfined 
-    environment: 
-      MARIADB_AUTO_UPGRADE: "1" 
-      MARIADB_DATABASE: photoview 
-      MARIADB_USER: photoview 
-      MARIADB_PASSWORD: << your random db password here >> 
-      MARIADB_ROOT_PASSWORD: << another random password here >> 
-    volumes: 
-      - "/etc/localtime:/etc/localtime:ro" ## use local time from host 
-      - "/etc/timezone:/etc/timezone:ro"   ## use timezone from host 
-      - "/data/daemons/photoview/database/mariadb:/var/lib/mysql" ## DO NOT REMOVE 
- 
-networks: 
-  photoview-net: {} 
-</file> 
- 
-You will need to setup some meaningful passwords for the database, and provide the proper paths. 
- 
-Also generate your MapBox token ([[https://account.mapbox.com/access-tokens/|here]]). 
- 
-Now pull the images: 
-<code bash> 
-su - photoview 
-podman compose pull 
-</code> 
- 
-===== Reverse Proxy ===== 
- 
-I placed PhotoView on a subdomain, and here is the relevant NGINX config: 
-<file - photoview.conf> 
-server { 
-        server_name photos.mydomain.com; 
-        listen 443 ssl;  
-        listen 8443 ssl;  
- 
-        access_log /var/log/nginx/photos.mydomain.com_access_log main; 
-        error_log /var/log/nginx/photos.mydomain.com_error_log info; 
- 
-        location / { 
-                proxy_pass http://127.0.0.1:8009; 
-                proxy_redirect    default; 
-                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-Host $server_name; 
-                proxy_set_header  X-Forwarded-Proto $scheme; 
-        } 
- 
-        client_max_body_size 100M; 
-} 
-</file> 
- 
-See [[selfhost:nginx|The Reverse Proxy concept]] for more details 
- 
-===== Autostart ===== 
- 
-To start it, and set it up on boot, as usual follow my indications [[gentoo:containers|Using Containers on Gentoo]], so link the **user-containers** init script: 
-<code> 
-ln -s /etc/init.d/user-containers /etc/init.d/user-containers.photoview 
-</code> 
- 
-and create the following config file: 
-<file - /etc/conf.d/user-containers.photoview> 
-USER=photoview 
-DESCRIPTION="The web gallery" 
-</file> 
- 
-Add the service to the default runlevel and start it now: 
-<code bash> 
-rc-update add user-containers.photoview default 
-rc-service user-containers.photoview start 
-</code> 
- 
- 
- 
- 
- 
- 
  

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information