From 16766e702ec81e6887cb3e30bd018648282825f8 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 30 Nov 2023 20:14:38 +0000 Subject: [PATCH] add basic-docker-compose (#59) --- .../basic-docker-compose/copyparty.conf | 28 +++++++++++++++++++ .../basic-docker-compose/docker-compose.yml | 20 +++++++++++++ scripts/docker/README.md | 4 +++ 3 files changed, 52 insertions(+) create mode 100644 docs/examples/docker/basic-docker-compose/copyparty.conf create mode 100644 docs/examples/docker/basic-docker-compose/docker-compose.yml diff --git a/docs/examples/docker/basic-docker-compose/copyparty.conf b/docs/examples/docker/basic-docker-compose/copyparty.conf new file mode 100644 index 00000000..6d6f419c --- /dev/null +++ b/docs/examples/docker/basic-docker-compose/copyparty.conf @@ -0,0 +1,28 @@ +# not actually YAML but lets pretend: +# -*- mode: yaml -*- +# vim: ft=yaml: + + +[global] + e2dsa # enable file indexing and filesystem scanning + e2ts # enable multimedia indexing + ansi # enable colors in log messages + + # ftp: 3921 # enable ftp server on port 3921 + # p: 3939 # listen on another port + # df: 16 # stop accepting uploads if less than 16 GB free disk space + # theme: 2 # monokai + # name: datasaver # change the server-name that's displayed in the browser + # stats, nos-dup # enable the prometheus endpoint, but disable the dupes counter (too slow) + # no-robots, force-js # make it harder for search engines to read your server + + +[accounts] + ed: wark # username: password + + +[/] # create a volume at "/" (the webroot), which will + /w # share /w (the docker data volume) + accs: + rw: * # everyone gets read-write access, but + rwmda: ed # the user "ed" gets read-write-move-delete-admin diff --git a/docs/examples/docker/basic-docker-compose/docker-compose.yml b/docs/examples/docker/basic-docker-compose/docker-compose.yml new file mode 100644 index 00000000..57a9868b --- /dev/null +++ b/docs/examples/docker/basic-docker-compose/docker-compose.yml @@ -0,0 +1,20 @@ +version: '3' +services: + + copyparty: + image: copyparty/ac:latest + container_name: copyparty + user: "1000:1000" + ports: + - 3923:3923 + volumes: + - ./:/cfg:z + - /path/to/your/fileshare/top/folder:/w:z + + stop_grace_period: 15s # thumbnailer is allowed to continue finishing up for 10s after the shutdown signal + healthcheck: + test: ["CMD-SHELL", "wget --spider -q 127.0.0.1:3923/?reset"] + interval: 1m + timeout: 2s + retries: 5 + start_period: 15s diff --git a/scripts/docker/README.md b/scripts/docker/README.md index d7993e85..9f46e83e 100644 --- a/scripts/docker/README.md +++ b/scripts/docker/README.md @@ -17,11 +17,15 @@ docker run --rm -it -u 1000 -p 3923:3923 -v /mnt/nas:/w -v $PWD/cfgdir:/cfg copy * if you are using rootless podman, remove `-u 1000` * if you have selinux, append `:z` to all `-v` args (for example `-v /mnt/nas:/w:z`) +this example is also available as a podman-compatible [docker-compose yaml](https://github.com/9001/copyparty/blob/hovudstraum/docs/examples/docker/basic-docker-compose); example usage: `docker-compose up` (you may need to `systemctl enable --now podman.socket` or similar) + i'm unfamiliar with docker-compose and alternatives so let me know if this section could be better 🙏 ## configuration +> this section basically explains how the [docker-compose yaml](https://github.com/9001/copyparty/blob/hovudstraum/docs/examples/docker/basic-docker-compose) works, so you may look there instead + the container has the same default config as the sfx and the pypi module, meaning it will listen on port 3923 and share the "current folder" (`/w` inside the container) as read-write for anyone the recommended way to configure copyparty inside a container is to mount a folder which has one or more [config files](https://github.com/9001/copyparty/blob/hovudstraum/docs/example.conf) inside; `-v /your/config/folder:/cfg`