Skip to content

Commit

Permalink
Postgres: Add docker-compose.postgres.yml, see photoprism#47
Browse files Browse the repository at this point in the history
Postgres support additionally requires a GORM upgrade to 2.0 (v1.20) as the current version doesn't support generic column types like "bytes" (VARBINARY in MySQL, different in Postgres and other SQL dialects).

Signed-off-by: Michael Mayer <[email protected]>
  • Loading branch information
lastzero committed Sep 6, 2020
1 parent fb984b4 commit 6577d99
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
69 changes: 69 additions & 0 deletions docker-compose.postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
version: '3.5'

services:
photoprism:
build: .
image: photoprism/photoprism:develop
security_opt:
- seccomp:unconfined
- apparmor:unconfined
depends_on:
- postgres
ports:
- "2342:2342" # Web Server (PhotoPrism)
- "2343:2343" # Acceptance Tests
volumes:
- ".:/go/src/github.com/photoprism/photoprism"
- "go-mod:/go/pkg/mod"
shm_size: "2gb"
environment:
TF_CPP_MIN_LOG_LEVEL: 0 # Show TensorFlow log messages for development
PHOTOPRISM_SITE_URL: "http://localhost:2342/"
PHOTOPRISM_SITE_TITLE: "PhotoPrism"
PHOTOPRISM_SITE_CAPTION: "Browse Your Life"
PHOTOPRISM_SITE_DESCRIPTION: "Open-Source Personal Photo Management"
PHOTOPRISM_SITE_AUTHOR: "@browseyourlife"
PHOTOPRISM_DEBUG: "true"
PHOTOPRISM_READONLY: "false"
PHOTOPRISM_PUBLIC: "true"
PHOTOPRISM_EXPERIMENTAL: "true"
PHOTOPRISM_UPLOAD_NSFW: "false"
PHOTOPRISM_DETECT_NSFW: "false"
PHOTOPRISM_SERVER_MODE: "debug"
PHOTOPRISM_HTTP_HOST: "0.0.0.0"
PHOTOPRISM_HTTP_PORT: 2342
PHOTOPRISM_DATABASE_DRIVER: "postgres"
PHOTOPRISM_DATABASE_DSN: "user=photoprism password=photoprism dbname=photoprism host=postgres port=5432 sslmode=disable TimeZone=UTC"
PHOTOPRISM_TEST_DRIVER: "sqlite"
PHOTOPRISM_TEST_DSN: ".test.db"
PHOTOPRISM_ADMIN_PASSWORD: "photoprism"
PHOTOPRISM_ASSETS_PATH: "/go/src/github.com/photoprism/photoprism/assets"
PHOTOPRISM_STORAGE_PATH: "/go/src/github.com/photoprism/photoprism/storage"
PHOTOPRISM_ORIGINALS_PATH: "/go/src/github.com/photoprism/photoprism/storage/originals"
PHOTOPRISM_IMPORT_PATH: "/go/src/github.com/photoprism/photoprism/storage/import"
PHOTOPRISM_THUMB_FILTER: "lanczos" # Resample filter, best to worst: blackman, lanczos, cubic, linear
PHOTOPRISM_THUMB_UNCACHED: "true" # Enable on-demand thumbnail rendering (high memory and cpu usage)
PHOTOPRISM_THUMB_SIZE: 2048 # Pre-rendered thumbnail size limit (default 2048, min 720, max 7680)
# PHOTOPRISM_THUMB_SIZE: 4096 # Retina 4K, DCI 4K (requires more storage); 7680 for 8K Ultra HD
PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # On-demand rendering size limit (default 7680, min 720, max 7680)
PHOTOPRISM_JPEG_SIZE: 7680 # Size limit for converted image files in pixels (720-30000)
PHOTOPRISM_JPEG_QUALITY: 92 # Set to 95 for high-quality thumbnails (25-100)
PHOTOPRISM_DARKTABLE_PRESETS: "false" # Use darktable presets (disables concurrent raw to jpeg conversion)
PHOTOPRISM_SIDECAR_JSON: "true" # Read metadata from JSON sidecar files created by exiftool
PHOTOPRISM_SIDECAR_YAML: "true" # Backup photo metadata to YAML sidecar files

postgres:
image: postgres:12-alpine
ports:
- "5432:5432"
environment:
POSTGRES_DB: photoprism
POSTGRES_USER: photoprism
POSTGRES_PASSWORD: photoprism

webdav-dummy:
image: photoprism/webdav:20200825

volumes:
go-mod:
driver: local
1 change: 1 addition & 0 deletions internal/config/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
const (
MySQL = "mysql"
SQLite = "sqlite3"
// Postgres = "postgres" // TODO: Requires GORM 2.0 for generic column data types
)

// Params provides a struct in which application configuration is stored.
Expand Down

0 comments on commit 6577d99

Please sign in to comment.