Skip to content

Commit

Permalink
feat: Improved systemd configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
tazarov committed May 16, 2024
1 parent b94bbc1 commit 6269095
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions docs/strategies/systemd-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 6269095

Please sign in to comment.