Create directory and enter it.
Create docker-compose.yml, change /cfg and /w (share) path in volumes section.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
services: copyparty: image: copyparty/ac:latest container_name: copyparty user: "1000:1000" ports: - 3923:3923 volumes: - /home/USER/Copyparty/data:/cfg:z - /mnt/TOP_DIR_TO_SHARE/:/w:z environment: LD_PRELOAD: /usr/lib/libmimalloc-secure.so.NOPE # enable mimalloc by replacing "NOPE" with "2" for a nice speed-boost (will use twice as much ram) PYTHONUNBUFFERED: 1 # ensures log-messages are not delayed (but can reduce speed a tiny bit) stop_grace_period: 15s # thumbnailer is allowed to continue finishing up for 10s after the shutdown signal healthcheck: # hide it from logs with "/._" so it matches the default --lf-url filter. test: ["CMD-SHELL", "wget --spider -q 127.0.0.1:3923/?reset=/._"] interval: 1m timeout: 2s retries: 5 start_period: 15s |
Create data directory
In data directory, create some_config.conf, change [accounts] section
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# not actually YAML but lets pretend: # -*- mode: yaml -*- # vim: ft=yaml: # append some arguments to the commandline; # accepts anything listed in --help (leading dashes are optional) # and inline comments are OK if there is 2 spaces before the '#' [global] # p: 8086, 3939 # listen on ports 8086 and 3939 e2dsa # enable file indexing and filesystem scanning e2ts # and enable multimedia indexing # z, qr # and zeroconf and qrcode (you can comma-separate arguments) # create users: [accounts] USERNAME: 123 # username: password # create volumes: [/] # create a volume at "/" (the webroot), which will . # share the contents of "." (the current directory) accs: r: * # everyone gets read-access, but rw: USERNAME # the user "USERNAME" gets read-write |
Update/run script
1 2 3 4 5 6 7 8 9 10 11 |
echo Stopping Copyparty... sudo docker stop copyparty echo Pulling new images... sudo docker pull copyparty/ac:latest echo Prunning unused images... sudo docker image prune -f echo Prunning unused containers... sudo docker container prune -f echo Running Copyparty... cd /home/USER/Copyparty sudo docker compose up -d |
Run the script and check if the site works by navigating to: