Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Photoprism #543

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ If you have a spare domain name you can configure applications to be accessible
* [Organizr](https://organizr.app/) - ORGANIZR aims to be your one stop shop for your Servers Frontend.
* [overseerr](https://docs.overseerr.dev) - open source software application for managing requests for your media library
* [Paperless_ng](https://github.com/jonaswinkler/paperless-ng) - Scan, index and archive all your physical documents
* [PhotoPrism](https://photoprism.app/) - AI-powered app for browsing, organizing & sharing your photo collection
* [Piwigo](https://piwigo.org/) - Photo Gallery Software
* [Plex](https://www.plex.tv/) - Plex Media Server
* [Portainer](https://portainer.io/) - for managing Docker and running custom images
Expand Down
4 changes: 4 additions & 0 deletions nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@
tags:
- paperless_ng

- role: photoprism
tags:
- photoprism

- role: piwigo
tags:
- piwigo
Expand Down
9 changes: 9 additions & 0 deletions roles/photoprism/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
photoprism_data_directory: "{{ docker_home }}/photoprism"
photoprism_photos_directory: "{{ photos_root }}"
photoprism_port: "2342"
photoprism_hostname: "photoprism"
photoprism_available_externally: false
photoprism_container_name: "photoprism"
photoprism_image_name: "photoprism/photoprism"
photoprism_image_version: "latest"
34 changes: 34 additions & 0 deletions roles/photoprism/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
- name: Create config directory
file:
path: "{{ item }}"
state: directory
mode: 0777
with_items:
- "{{ photoprism_data_directory }}/storage"
when: (photoprism_enabled | default(False))

- name: Install Docker container
docker_container:
name: "{{ photoprism }}"
image: "{{ photoprism_image_name }}/{{ photoprism_image_version }}"
pull: true
ports:
- "{{ photoprism_port }}:2342"
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "{{ photoprism_data_directory }}/storage:/photoprism/storage:rw"
- "{{ photoprism_photos_directory }}:/photoprism/originals:rw"
env:
PHOTOPRISM_SITE_URL: "https://{{ photoprism_hostname }}.{{ ansible_nas_domain }}"
PHOTOPRISM_ADMIN_PASSWORD: "insecure"
restart_policy: unless-stopped
memory: 4g
labels:
traefik.enable: "{{ photoprism_available_externally }}"
traefik.http.routers.photoprism.rule: "Host(`{{ photoprism_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.photoprism.tls.certresolver: "letsencrypt"
traefik.http.routers.photoprism.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.photoprism.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.photoprism.loadbalancer.server.port: "2342"
when: (photoprism_enabled | default(False))
17 changes: 17 additions & 0 deletions website/docs/applications/download-tools/photoprism.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# PhotoPrism

Homepage: [https://photoprism.app/](https://photoprism.app/)

## Usage

Set `photoprism_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.

The default user is `admin` and its password is `insecure`. To set the admin password run the following command:

```
docker exec -ti photoprism photoprism passwd
```

More commands can be found [here](https://docs.photoprism.app/getting-started/docker/#examples)
PhotoPrism creates a database in `photoprism_data_directory`.