Move Cloudplow to Docker

This commit is contained in:
Scott Wallace 2019-10-20 10:13:56 +01:00
parent d6a6170f74
commit ba74d60a9c
4 changed files with 17 additions and 145 deletions

View file

@ -1,17 +0,0 @@
[Unit]
Description=cloudplow
After=mnt-media.mount
Requires=mnt-media.mount
[Service]
User=media
Group=media
Type=simple
WorkingDirectory=/srv/app/cloudplow/
ExecStart=/srv/app/cloudplow/.venv/bin/python3 /srv/app/cloudplow/cloudplow.py run --loglevel=INFO
ExecStopPost=/bin/rm -rf /srv/app/cloudplow/locks
Restart=always
RestartSec=10
[Install]
WantedBy=default.target

View file

@ -1,61 +0,0 @@
{
"core": {
"dry_run": false,
"rclone_binary_path": "/usr/bin/rclone",
"rclone_config_path": "/srv/etc/rclone/rclone.conf"
},
"hidden": {
"/mnt/.media.cache/.unionfs": {
"hidden_remotes": [
"google"
]
}
},
"notifications": {},
"remotes": {
"google": {
"hidden_remote": "GoogleDriveCrypt:",
"rclone_command": "move",
"rclone_excludes": [
"**partial~",
"**_HIDDEN~",
".unionfs/**"
],
"rclone_extras": {
"--bwlimit": "23:00,off 07:00,1M",
"--checkers": 16,
"--drive-chunk-size": "64M",
"--skip-links": null,
"--stats": "60s",
"--transfers": 4,
"--verbose": 1
},
"rclone_sleeps": {
"Failed to copy: googleapi: Error 403: User rate limit exceeded": {
"count": 5,
"sleep": 25,
"timeout": 3600
}
},
"remove_empty_dir_depth": 2,
"sync_remote": "GoogleDriveCrypt:",
"upload_folder": "/mnt/.media.cache",
"upload_remote": "GoogleDriveCloudplowUpload:"
}
},
"syncer": {},
"uploader": {
"google": {
"check_interval": 1,
"exclude_open_files": true,
"max_size_gb": 10,
"opened_excludes": [],
"schedule": {
"allowed_from": "04:00",
"allowed_until": "08:00",
"enabled": false
},
"size_excludes": []
}
}
}

View file

@ -99,3 +99,18 @@ services:
ports: ports:
- 8989:8989 - 8989:8989
restart: unless-stopped restart: unless-stopped
cloudplow:
image: sabrsorensen/alpine-cloudplow
container_name: cloudplow
environment:
- PUID=1003
- PGID=1003
- TZ=Europe/London
- UMASK_SET=022
volumes:
- /srv/app/docker/mediaserver/config/cloudplow:/config:rw
- /srv/etc/rclone:/config/rclone:rw
- /mnt/.media.cache:/data/imported_media:rw
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped

View file

@ -5,7 +5,7 @@
- name: "Media Server: Group" - name: "Media Server: Group"
tags: tags:
- install - install
- cloudplow - docker
group: group:
name: "media" name: "media"
become: yes become: yes
@ -13,7 +13,7 @@
- name: "Media Server: User" - name: "Media Server: User"
tags: tags:
- install - install
- cloudplow - docker
user: user:
name: "media" name: "media"
group: "media" group: "media"
@ -21,71 +21,6 @@
expires: -1 expires: -1
become: yes become: yes
- name: "Media Server: Cloudplow: git repo"
tags:
- install
- cloudplow
git:
repo: "https://github.com/l3uddz/cloudplow.git"
dest: "/srv/app/cloudplow"
become: yes
- name: "Media Server: Cloudplow: directory permissions"
tags:
- install
- cloudplow
file:
path: "/srv/app/cloudplow"
state: directory
mode: "u+w"
owner: "media"
group: "media"
recurse: yes
become: yes
- name: "Media Server: Cloudplow: config"
tags:
- config
- cloudplow
copy:
src: "files/cloudplow_config.json"
dest: "/srv/app/cloudplow/config.json"
mode: "0600"
owner: "media"
group: "media"
become: yes
- name: "Media Server: Cloudplow: Python dependencies"
tags:
- install
- cloudplow
pip:
requirements: "/srv/app/cloudplow/requirements.txt"
virtualenv: "/srv/app/cloudplow/.venv"
virtualenv_python: python3
become: yes
- name: "Media Server: Cloudplow: service config"
tags:
- install
- cloudplow
copy:
dest: "/etc/systemd/system/cloudplow.service"
src: "files/cloudplow.service"
mode: "0644"
become: yes
- name: "Media Server: Cloudplow: service"
tags:
- config
- cloudplow
systemd:
name: "cloudplow"
state: started
enabled: yes
daemon_reload: yes
become: yes
- name: "Media Server: Docker: packages" - name: "Media Server: Docker: packages"
tags: tags:
- install - install