aboutsummaryrefslogtreecommitdiffstats
path: root/docs/docker.md
diff options
context:
space:
mode:
authorAndrew Metzger <andrewjmetzger@users.noreply.github.com>2023-12-03 11:16:23 -0500
committerAndrew Metzger <andrewjmetzger@users.noreply.github.com>2023-12-03 11:16:23 -0500
commitca84e7df765f2a0c301a4a5db731a0352fb205e1 (patch)
treeabb16ffe863da29bee539791c9116910210fe3d8 /docs/docker.md
parent215c7d8607b2e60256e984108372fcebd6457546 (diff)
downloadslskd-ca84e7df765f2a0c301a4a5db731a0352fb205e1.tar.gz
Explain docker --user, add compose examples
Closes slskd/slskd#473
Diffstat (limited to 'docs/docker.md')
-rw-r--r--docs/docker.md49
1 files changed, 46 insertions, 3 deletions
diff --git a/docs/docker.md b/docs/docker.md
index e5849b8e..0d105927 100644
--- a/docs/docker.md
+++ b/docs/docker.md
@@ -22,9 +22,10 @@ docker run -d \
This configuration, however, doesn't include any shared directories.
-First, you need to map each share to the container as a volume. Then each local directory within the container needs to be added to the configuration.
+First, you need to map each share to the container as a volume. Then each local directory within the container needs to be added to the configuration. You may also need to specify the user and group ID that should run the container and own files created by slskd. The default is `root:root`, but Docker will accept any numeric values in the `UID:GID` format, such as `1000:1000` in this example.
+
+In the following example, assume that the slskd application directory will be `/var/slskd` on the docker host. Assume that the directories `/home/JohnDoe/Music` and `/home/JohnDoe/eBooks` will be shared.
-In the following example, assume that the slskd application directory will be `/var/slskd` on the docker host. Assume that the directories `/home/JohnDoe/Music` and `/home/JohnDoe/eBooks` will be shared.
For this scenario, the `docker run` command would be:
@@ -38,10 +39,30 @@ docker run -d \
-v /home/JohnDoe/Music:/music \
-v /home/JohnDoe/eBooks:/ebooks \
--name slskd \
+ --user 1000:1000 \
slskd/slskd:latest
```
-And the YAML configuration file would contain:
+Or, for `docker-compose`:
+
+```yaml
+version: "3"
+services:
+ slskd:
+ environment:
+ - SLSKD_REMOTE_CONFIGURATION=true
+ ports:
+ - 5030:5030/tcp
+ - 5031:5031/tcp
+ - 50300:50300/tcp
+ volumes:
+ - /var/slskd:/app:rw
+ - /home/JohnDoe/Music:/music:rw
+ - /home/JohnDoe/eBooks:/ebooks:rw
+ user: 1000:1000
+ image: slskd/slskd:latest
+```
+The YAML configuration file would contain:
```yaml
shares:
@@ -63,5 +84,27 @@ docker run -d \
-v /home/JohnDoe/eBooks:/ebooks \
-e "SLSKD_SHARED_DIR=/music;/ebooks" \
--name slskd \
+ --user 1000:1000 \
slskd/slskd:latest
+```
+
+Or, for `docker-compose`:
+
+```yaml
+version: "3"
+services:
+ slskd:
+ environment:
+ - SLSKD_REMOTE_CONFIGURATION=true
+ - "SLSKD_SHARED_DIR=/music;/ebooks"
+ ports:
+ - 5030:5030/tcp
+ - 5031:5031/tcp
+ - 50300:50300/tcp
+ volumes:
+ - /var/slskd:/app:rw
+ - /home/JohnDoe/Music:/music:rw
+ - /home/JohnDoe/eBooks:/ebooks:rw
+ user: 1000:1000
+ image: slskd/slskd:latest
``` \ No newline at end of file