Docker Compose
Docker compose simplifies the configuration of containers and connected services. Following example starts the HomeGallery with a local API server.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | version: "3.9"
services:
api:
# custom build via
#build: packages/api-server
image: xemle/home-gallery-api-server
environment:
# TensorflowJS backends: cpu, wasm and node. Use wasm
# if you have troubles.
#- BACKEND=cpu
#- BACKEND=wasm
- BACKEND=node
ports:
- "3000"
gallery:
# custom build via
#build: .
image: xemle/home-gallery
environment:
- GALLERY_API_SERVER=http://api:3000
- GALLERY_OPEN_BROWSER=false
volumes:
- ./data:/data
# Mount your media directories below /data
- ${HOME}/Pictures:/data/Pictures
ports:
- "3000:3000"
user: "${CURRENT_USER}"
entrypoint: ['node', '/app/gallery.js', 'run', 'server']
|
Note
The example uses node
backend in the API server which is only
supported for amd64 hosts. Use BACKEND=wasm
on Raspberry PIs or
if you discover troubles.
Quickstart
1 2 3 4 5 | mkdir -p data
echo "CURRENT_USER=$(id -u):$(id -g)" >> .env
docker-compose exec gallery /app/gallery.js run init --source /data/Pictures
docker-compose up
docker-compose exec gallery /app/gallery.js run import --update
|