xemle / home-gallery

Self-hosted open-source web gallery to view your photos and videos featuring mobile-friendly, tagging and AI powered image discovery
https://home-gallery.org
MIT License
805 stars 61 forks source link

Api server docker container runs on console? #57

Closed Qomaa closed 1 year ago

Qomaa commented 1 year ago

Hi,

when I run the API server docker image, the server is executed in my console and not in background.

$ sudo docker run -p 3002:3000 xemle/home-gallery-api-server

Loading tensorflow and models
Load tensorflow width wasm backend in 253ms
Loading model from /app/models/mobilenet-1-100/model.json
Loaded mobilenet model in 1945ms
Loaded faceapi model in 934ms
Loading model from /app/models/coco-ssd-mobilenet_v2/model.json
Loaded coco ssd model in 8434ms
Starting server
Listen on port http://localhost:3000
Setup api routes
Server is up and running

How to run the server in background in the docker container? Or is there a different idea behind the API server?

xemle commented 1 year ago

You need to run the docker in detached mode with -d option, see docker run help:

$ sudo docker run -d -p 3002:3000 xemle/home-gallery-api-server
Qomaa commented 1 year ago

Thank you! I'm still new to docker.

xemle commented 1 year ago

I'm still new to docker.

That is fine.

I propose to use docker-compose which gives you nicer configuration file