Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata
WD=/opt/transmission
mkdir -p $WD/{setup,conf,downloads,watch}
cd $WD/setup
cat << 'EOF' >docker-compose.yaml
version: '3.7'

services:
 transmission:
    container_name: transmission
    hostname: transmission
    image: linuxserver/transmission
    ports:
      - '9091:9091'
      - '51413:51413'
    volumes:
      - type: bind
        source: /opt/transmission/conf/
        target: /config
      - type: bind
        source: /opt/transmission/downloads/
        target: /downloads
      - type: bind
        source: /opt/transmission/watch/
        target: /watch

    environment:
      - 'TZ=America/Whitehorse'
      - 'USER=transmission'
      - 'PASS=transmission'

EOF
chmod +x docker-compose.yaml
WD=/opt/transmission/setup
cat << EOF >$WD/transmission.service.setup.sh
cat << EOL >/lib/systemd/system/transmission.service
[Unit]
Description=transmission_Docker
Requires=docker.service network-online.target

[Service]

Restart=on-abnormal
ExecStart=/usr/bin/docker-compose --project-name transmission --project-directory $WD -f $WD/docker-compose.yaml up
ExecStop=/usr/bin/docker-compose --project-name transmission --project-directory $WD -f $WD/docker-compose.yaml stop

[Install]
WantedBy=multi-user.target
EOL
systemctl enable transmission
systemctl restart transmission
systemctl status transmission
EOF
chmod +x $WD/transmission.service.setup.sh
$WD/transmission.service.setup.sh
  • No labels