Docker: Update ARM docker-compose.yml examples and README #1680

This commit is contained in:
Michael Mayer 2021-12-08 11:01:58 +01:00
parent de1cd4d430
commit 0e48bc7912
3 changed files with 50 additions and 84 deletions

View file

@ -1,96 +1,61 @@
PhotoPrism for the Raspberry Pi and other ARM-based devices
===========================================================
# Running PhotoPrism on a Raspberry Pi
Our latest release comes as a single multi-arch image for AMD64, ARM64, and ARMv7.
If your device meets the system requirements, the same installation instructions
as for regular Linux servers apply.
Our stable version and development preview now come as a single multi-arch image for AMD64, ARM64, and ARMv7:
To get started, simply download our example config
https://hub.docker.com/r/photoprism/photoprism
https://dl.photoprism.org/docker/arm64/docker-compose.yml
If your device meets the system requirements, mostly the same installation instructions as for regular Linux
servers apply:
to a folder of your choice, change it as needed, and run "docker-compose up":
https://docs.photoprism.org/getting-started/docker-compose/
wget https://dl.photoprism.org/docker/arm64/docker-compose.yml
sudo docker-compose up -d
!!! Docker Image Name
Use `photoprism/photoprism:latest` for the stable release or `photoprism/photoprism:preview` for testing
preview builds. Make sure to [pull the most recent image](updates.md) from Docker Hub. Existing users are advised to
update their `docker-compose.yml` config based on our examples for [ARM64](https://dl.photoprism.org/docker/arm64/docker-compose.yml)
and [ARMv7](https://dl.photoprism.org/docker/armv7/docker-compose.yml)-based devices.
Always change PHOTOPRISM_ADMIN_PASSWORD so that the app starts with a secure initial password.
Never use easy-to-guess passwords or default values like insecure on publicly accessible servers.
There is no default in case no password was provided. A minimum length of 4 characters is required.
!!! ARMv7-based Devices
Owners of [ARMv7-based devices](https://dl.photoprism.org/docker/armv7/docker-compose.yml) have to revert to
an [alternative image](https://hub.docker.com/r/linuxserver/mariadb) if they want to use MariaDB.
The [official image](https://hub.docker.com/_/mariadb) is available for AMD64 and ARM64 only.
Pay close attention to changed directory and environment variable names.
For more details, see:
- https://docs.photoprism.org/getting-started/docker-compose/
- https://docs.photoprism.org/getting-started/config-options/
All commands may have to be prefixed with "sudo" when not running as root.
This will change the home directory "~" to "/root" in your configuration.
Our repository on Docker Hub:
- https://hub.docker.com/r/photoprism/photoprism
## Docker Compose Command Reference ##
The help command shows a complete list of commands and config options.
Use the --help flag to see a detailed command info like
"docker-compose exec photoprism photoprism backup --help".
| Action | Command
|----------|---------------------------------------------------------
| Start | docker-compose up -d
| Stop | docker-compose stop
| Update | docker-compose pull
| Logs | docker-compose logs --tail=25 -f
| Terminal | docker-compose exec photoprism bash
| Help | docker-compose exec photoprism photoprism help
| Config | docker-compose exec photoprism photoprism config
| Reset | docker-compose exec photoprism photoprism reset
| Backup | docker-compose exec photoprism photoprism backup -a -i
| Restore | docker-compose exec photoprism photoprism restore -a -i
| Index | docker-compose exec photoprism photoprism index
| Re-index | docker-compose exec photoprism photoprism index -f
| Import | docker-compose exec photoprism photoprism import
More examples: https://docs.photoprism.org/getting-started/docker-compose/#command-line-interface
"photoprism index -f" will re-index all originals, including already indexed and unchanged files.
This may be necessary after upgrading, especially to new major versions.
## System Requirements ##
It's important that you boot your Raspberry Pi 3 / 4 with the parameter "arm_64bit=1"
in config.txt to use our ARM64 image.
Alternatively, you may run it on UbuntuDockerPi (https://github.com/guysoft/UbuntuDockerPi).
It's a 64bit Ubuntu Server with Docker pre-installed.
Your device should have at least 4 GB of memory. Also make sure it has at least 4 GB of swap
configured, so that indexing doesn't cause restarts when there are memory usage spikes.
Beyond these minimum requirements, the amount of RAM should match the number of cores.
Indexing large photo and video collections significantly benefits from fast, local SSD storage,
and lots of memory for caching. Especially the conversion of RAW images and the transcoding of
videos are very demanding.
## Reducing Server Load ##
If you're running out of memory - or other system resources - while indexing, please limit the
number of workers by setting PHOTOPRISM_WORKERS to a value less than the number of logical CPU cores
in docker-compose.yml.
As a measure of last resort, you may disable using TensorFlow for image classification and facial recognition.
To avoid permission issues, docker-compose.yml should include the following security options:
### System Requirements ###
- Your device should have at least 4 GB of memory. Running PhotoPrism on a server with less than 4 GB of swap space
or setting a memory/swap limit can cause unexpected restarts, especially when the indexer temporarily needs more
memory to process large files.
- It's important to [boot](https://www.raspberrypi.org/documentation/installation/installing-images/README.md) your
Raspberry Pi 3 / 4 with the parameter `arm_64bit=1` in `config.txt` to use our ARM64 (64-bit) image.
An "exec format error" will occur otherwise. Alternatively, you may run it on
[UbuntuDockerPi](https://github.com/guysoft/UbuntuDockerPi). It's a 64bit Ubuntu Server with Docker pre-installed.
- If you see Docker errors related to "cgroups", it may help to add the following to `/boot/firmware/cmdline.txt`:
```
cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1
```
- We recommend disabling Linux kernel security in your [docker-compose.yml](https://dl.photoprism.org/docker/arm64/docker-compose.yml),
especially if you do not have experience with the configuration:
```yaml
photoprism:
security_opt:
- seccomp:unconfined
- apparmor:unconfined
```
- If you install PhotoPrism on a public server outside your home network, please always run it behind a secure
HTTPS reverse proxy such as Traefik, Caddy, or NGINX. Your files and passwords will otherwise be transmitted in
clear text and can be intercepted by anyone, including your provider, hackers, and governments.
## More Information ##
- https://docs.photoprism.org/getting-started/raspberry-pi/
- https://docs.photoprism.org/getting-started/faq/#why-is-photoprism-getting-stuck-in-a-restart-loop
- https://www.raspberrypi.org/documentation/installation/installing-images/README.md
!!! Note
Indexing large photo and video collections significantly benefits from fast, local SSD storage,
and plenty of memory for caching. Especially the conversion of RAW images and the transcoding of
videos are very demanding.
!!! Reducing System Load
If you're running out of memory - or other system resources - while indexing, try reducing the
[number of workers](https://docs.photoprism.org/getting-started/config-options/) by setting
`PHOTOPRISM_WORKERS` to a reasonably small value in `docker-compose.yml` (depending on the performance of the server).
As a measure of last resort, you may disable using TensorFlow for image classification and facial recognition.
Big thank you to [Guy Sheffer](https://github.com/guysoft)
for [building](https://github.com/photoprism/photoprism/issues/109) this!

View file

@ -3,8 +3,9 @@ version: '3.5'
# Example Docker Compose config file for PhotoPrism (Raspberry Pi 3/4 and other ARM64-based devices)
#
# Note:
# - Use https://dl.photoprism.org/docker/armv7/docker-compose.yml for running PhotoPrism on ARMv7-based devices.
# - You have to boot your Raspberry Pi 3/4 with the parameter "arm_64bit=1" in config.txt to use our ARM64 image.
# - You have to boot your Raspberry Pi 3/4 with the parameter "arm_64bit=1" in config.txt to use our ARM64 (64-bit) image.
# An "exec format error" will occur otherwise.
# - Use https://dl.photoprism.org/docker/armv7/docker-compose.yml for running PhotoPrism on ARMv7-based (32-bit) devices.
# - Running PhotoPrism on a server with less than 4 GB of swap space or setting a memory/swap limit can cause unexpected
# restarts ("crashes"), especially when the indexer temporarily needs more memory to process large files.
# - If you see Docker errors related to "cgroups", it may help to add the following to /boot/firmware/cmdline.txt:

View file

@ -3,7 +3,7 @@ version: '3.5'
# Example Docker Compose config file for PhotoPrism (ARMv7-based devices)
#
# Note:
# - Use https://dl.photoprism.org/docker/arm64/docker-compose.yml for running PhotoPrism on ARM64-based devices.
# - Use https://dl.photoprism.org/docker/arm64/docker-compose.yml for running PhotoPrism on ARM64-based (64-bit) devices.
# - Running PhotoPrism on a server with less than 4 GB of swap space or setting a memory/swap limit can cause unexpected
# restarts ("crashes"), especially when the indexer temporarily needs more memory to process large files.
# - If you see Docker errors related to "cgroups", it may help to add the following to /boot/firmware/cmdline.txt: