Closed Steven11q closed 10 months ago
Indention is a key in YAML, so it is better to use the code formatting here and format it correctly.
Here is my docker-compose.yml
(part of it):
version: '3.9'
services:
## Watchtower upgrades services automatically (optional)
watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
restart: unless-stopped
## Uncomment next line and add the same line to the service definition, which you'd like to be auto-updated by Watchtower ONLY.
## In this way you'll tell Watchtower to update ONLY that service, while now it will update all of them.
# profiles: ["update"]
environment:
WATCHTOWER_CLEANUP: ${WATCHTOWER_CLEANUP}
WATCHTOWER_POLL_INTERVAL: ${WATCHTOWER_POLL_INTERVAL} #in sec, checks for updates every 24 hours
WATCHTOWER_TIMEOUT: ${WATCHTOWER_TIMEOUT}
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/home/user/.docker/config.json:/config.json:ro" # optional, for authentication if you have a Docker Hub account
- "/etc/localtime:/etc/localtime:ro" # use timezone from host
- "/etc/timezone:/etc/timezone:ro" # use timezone from host
## Copyparty is a web-based file manager allowing you to manage your media and upload files from any device (optional)
copyparty:
image: copyparty/iv:latest
container_name: copyparty
restart: unless-stopped
user: "1001:1001"
stop_grace_period: 10s
ports:
- "8800:8086"
## Security options for some restricted systems
security_opt:
- seccomp:unconfined
- apparmor:unconfined
devices:
## Uncomment next devices mappings if they are available in your host system
## Intel QSV
- "/dev/dri:/dev/dri"
## Nvidia CUDA
# - "/dev/nvidia0:/dev/nvidia0"
# - "/dev/nvidiactl:/dev/nvidiactl"
# - "/dev/nvidia-modeset:/dev/nvidia-modeset"
# - "/dev/nvidia-nvswitchctl:/dev/nvidia-nvswitchctl"
# - "/dev/nvidia-uvm:/dev/nvidia-uvm"
# - "/dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools"
## Video4Linux Video Encode Device (h264_v4l2m2m)
# - "/dev/video11:/dev/video11"
volumes:
## Make sure copyparty can read/write to the mounted volume
## Mount local folder as a repository:
- "${HOST_MEDIA_ROOT}:/media"
## Load your own custom configuration file
- "${HOST_LOCATION}/copyparty:/cfg"
- "/etc/localtime:/etc/localtime:ro" # use timezone from host
- "/etc/timezone:/etc/timezone:ro" # use timezone from host
healthcheck:
test: ["CMD-SHELL", "wget --spider --quiet --no-check-certificate https://localhost:8086/ || exit 1"]
interval: 1m
timeout: 2s
retries: 5
start_period: 30s
Thanks! I'll use that to start an examples section somewhere, will have to think about where to put it though :>
Just to explain the stuff Konstantin mentioned; github uses markdown for comment formatting, so the trick is to add a line with three backticks (```) before and after the yaml text. But it kept the spaces in the edit history, so no problem :+1:
EDIT: should mention I haven't forgotten about this! but I'll be busy with other stuff through most of December so I'll pick all this back up around then :>
Hello, you said you were unfamiliar with docker compose so I rewrote the run command in compose. If you'd like you can include this in the same section as the docker run command.