From 62690957c772fad2eb3abf3f369412e5667b8566 Mon Sep 17 00:00:00 2001 From: Trayan Azarov Date: Thu, 16 May 2024 14:31:16 +0300 Subject: [PATCH] feat: Improved systemd configurations --- docs/strategies/systemd-service.md | 31 ++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/docs/strategies/systemd-service.md b/docs/strategies/systemd-service.md index 7811f70..9ef9ce2 100644 --- a/docs/strategies/systemd-service.md +++ b/docs/strategies/systemd-service.md @@ -20,9 +20,9 @@ After = network.target docker.service Requires = docker.service [Service] -Type=forking -User=root -Group=root +Type = forking +User = root +Group = root WorkingDirectory = /home/admin/chroma ExecStart = /usr/bin/docker compose up -d ExecStop = /usr/bin/docker compose down @@ -35,6 +35,13 @@ WantedBy = multi-user.target Replace `WorkingDirectory` with the path to your docker compose is. You may also need to replace `/usr/bin/docker` with the path to your docker binary. +Alternatively you can install directly from a gist: + +```bash +wget https://gist.githubusercontent.com/tazarov/9c46966de0b32a4962dcc79dce8b2646/raw/7cf8c471f33fba8a51d6f808f9b1af6ca1b0923c/chroma-docker.service \ + -O /etc/systemd/system/chroma.service +``` + Loading, enabling and starting the service: ```bash @@ -65,9 +72,9 @@ Description = Chroma Service After = network.target [Service] -Type=simple -User=root -Group=root +Type = simple +User = root +Group = root WorkingDirectory = /chroma ExecStart=/usr/local/bin/chroma run --host 127.0.0.1 --port 8000 --path /chroma/data --log-path /var/log/chroma.log @@ -77,6 +84,18 @@ WantedBy = multi-user.target Replace the `WorkingDirectory`, `/chroma/data` and `/var/log/chroma.log` with the appropriate paths. +!!! note "Safe Config" + + The above example service listens and `localhost` which may not work if you are looking to expose Chroma to outside world. + Adjust the `--host` and `--port` flags as needed. + +Alternatively you can install from a gist: + +```bash +wget https://gist.githubusercontent.com/tazarov/5e10ce892c06757d8188a8a34cd6d26d/raw/327a9d0b07afeb0b0cb77453aa9171fdd190984f/chroma-cli.service \ + -O /etc/systemd/system/chroma.service +``` + Loading, enabling and starting the service: ```bash