From 4917753d7d8c9793c8e2a880e123c594c8aaae20 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Sat, 3 Apr 2021 22:39:07 -0500 Subject: [PATCH] Initial commit --- .gitignore | 8 ++++++++ .gitmodules | 3 +++ README.md | 10 ++++++++++ docker-compose.dev.yml | 16 ++++++++++++++++ docker-compose.prod.yml | 0 docker-compose.yml | 38 ++++++++++++++++++++++++++++++++++++++ setup.sh | 3 +++ torrent-client | 1 + 8 files changed, 79 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 README.md create mode 100644 docker-compose.dev.yml create mode 100644 docker-compose.prod.yml create mode 100644 docker-compose.yml create mode 100644 setup.sh create mode 160000 torrent-client diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4781b59 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +# Docker secrets +.secrets + +# Ignore +.vpn.env + +# VS Code +.vscode diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4195774 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "torrent-client"] + path = torrent-client + url = ssh://git@git.dlii.tech:222/Autoplex/autoplex.git diff --git a/README.md b/README.md new file mode 100644 index 0000000..60c573a --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Autoplex + +Autoplex is an all-in-one media management utility for Plex. + +## Setup + +1. Clone this repository with all submodules +2. Configure `.env` files inside each submodule +3. Execute the `setup.sh` script to generate secrets for the containers +4. Deploy using `docker-compose` diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..fa33e01 --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,16 @@ +version: "3.9" + +services: + torrent: + build: + target: base + ports: + - 9229:9229 + volumes: + - ./torrent-client:/app + ulimits: + # core: + # hard: -1 + # soft: -1 + entrypoint: "/bin/sh" + tty: true diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..269528d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,38 @@ +version: "3.9" + +services: + torrent: + build: + context: ./torrent-client + depends_on: + - "database" + env_file: + - ./torrent-client/.env + links: + - "database" + secrets: + - mysql_root_password + + database: + image: mysql + command: --default-authentication-plugin=mysql_native_password + restart: always + environment: + MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql_root_password + ports: + - 33060:3306 + security_opt: + - seccomp=unconfined + secrets: + - mysql_root_password + volumes: + - ./database/init:/docker-entrypoint-initdb.d + - mysql:/var/lib/mysql + +secrets: + mysql_root_password: + file: ./.passwords/mysql_root_password + +volumes: + autoplex: + mysql: diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..b067bcd --- /dev/null +++ b/setup.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +openssl rand -base64 20 > .secrets/mysql_root_password diff --git a/torrent-client b/torrent-client new file mode 160000 index 0000000..aa6b537 --- /dev/null +++ b/torrent-client @@ -0,0 +1 @@ +Subproject commit aa6b5379153c5f624afc3eeb9d3f4b70641aed04