1# Running Soft-Serve with Docker
2
3The official Soft Serve Docker images are available at [charmcli/soft-serve][docker]. Development and nightly builds are available at [ghcr.io/charmbracelet/soft-serve][ghcr]
4
5```sh
6docker pull charmcli/soft-serve:latest
7```
8
9Here’s how you might run `soft-serve` as a container. Keep in mind that
10repositories are stored in the `/soft-serve` directory, so you’ll likely want
11to mount that directory as a volume in order keep your repositories backed up.
12
13```sh
14docker run \
15 --name=soft-serve \
16 --volume /path/to/data:/soft-serve \
17 --publish 23231:23231 \
18 --publish 23232:23232 \
19 --publish 23233:23233 \
20 --publish 9418:9418 \
21 -e SOFT_SERVE_INITIAL_ADMIN_KEYS="YOUR_ADMIN_KEY_HERE" \
22 --restart unless-stopped \
23 charmcli/soft-serve:latest
24```
25
26Or by using docker-compose:
27
28```yaml
29---
30version: "3.1"
31services:
32 soft-serve:
33 image: charmcli/soft-serve:latest
34 container_name: soft-serve
35 volumes:
36 - /path/to/data:/soft-serve
37 ports:
38 - 23231:23231
39 - 23232:23232
40 - 23233:23233
41 - 9418:9418
42 environment:
43 SOFT_SERVE_INITIAL_ADMIN_KEYS: "YOUR_ADMIN_KEY_HERE"
44 restart: unless-stopped
45```
46
47[docker]: https://hub.docker.com/r/charmcli/soft-serve
48[ghcr]: https://github.com/charmbracelet/soft-serve/pkgs/container/soft-serve
49
50
51> **Warning**
52>
53> Make sure to run the image without a TTY, i.e.: do not use the `--tty`/`-t`
54> flags.
55
56
57***
58
59Part of [Charm](https://charm.sh).
60
61<a href="https://charm.sh/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-badge-unrounded.jpg" width="400"></a>
62
63Charm热爱开源 • Charm loves open source