Add docker

This commit is contained in:
Matt Strenk 2024-01-09 01:34:48 -05:00
parent e097a07ca5
commit b2ccbe42ce
4 changed files with 76 additions and 13 deletions

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM python:3-slim
WORKDIR /usr/src/app
COPY . ./
RUN pip install -r requirements.txt
RUN mkdir -p /root/.config/plexapi
RUN cp config.ini /root/.config/plexapi/config.ini

View File

@ -4,14 +4,51 @@
Most of these scripts utilize a combination of [Tautulli](https://github.com/Tautulli/Tautulli), [python-plexapi](https://github.com/pkkid/python-plexapi), and [requests](http://docs.python-requests.org/en/master/user/install/#install).
For use of config.ini for common variables please use [plexapi.CONFIG](http://python-plexapi.readthedocs.io/en/latest/configuration.html)
## Usage
Default location `~/.config/plexapi/config.ini`
```python
# To find path
import plexapi
print(plexapi.CONFIG_PATH)
Clone this repo to get started!
### Docker (with make)
Edit the config.ini file to include your information.
```
make build
make ARGS="utility/library_growth.py -h"
```
### Docker (without make)
Edit the config.ini file to include your information
```
docker build -t jbops .
docker run --rm -v .:/usr/src/app jbops python3 utility/library_growth.py -h
```
### Without Docker
> [!NOTE]
> You can either use the config.ini file to configure the scripts or you can edit each of the scripts manually.
> For use of config.ini for common variables please use [plexapi.CONFIG](http://python-plexapi.readthedocs.io/en/latest/configuration.html)
> Default location `~/.config/plexapi/config.ini`
> ```python
> # To find path
> import plexapi
> print(plexapi.CONFIG_PATH)
> ```
Install the required Python Packages
```
pip install -r requirements.txt
```
Run the scripts
```
python3 utility/library_growth.py -h
```
> [!TIP]
> Each of the scripts has a help menu that can be displayed with either `-h` or `--help`
### Contact
[![PM](https://img.shields.io/badge/Discord-Scripts-lightgrey.svg?colorB=7289da)](https://discord.gg/tQcWEUp) [![PM](https://img.shields.io/badge/Reddit-Message-lightgrey.svg)](https://www.reddit.com/user/Blacktwin/) [![PM](https://img.shields.io/badge/Plex-Message-orange.svg)](https://forums.plex.tv/u/blacktwin) [![Issue](https://img.shields.io/badge/Submit-Issue-red.svg)](https://github.com/blacktwin/JBOPS/issues/new)

11
makefile Normal file
View File

@ -0,0 +1,11 @@
.DEFAULT_GOAL := run
run:
@if [ -n "$(ARGS)" ]; then \
docker run --rm -v .:/usr/src/app jbops python3 $(ARGS); \
else \
echo "No script passed! Example: make ARGS='utility/library_growth.py'"; \
fi
build:
docker build -t jbops .

View File

@ -1,7 +1,13 @@
#---------------------------------------------------------
# Potential requirements.
# pip install -r requirements.txt
#---------------------------------------------------------
requests
plexapi
urllib3
flatten_json==0.1.14
future==0.18.3
gmusicapi==13.0.0
google_api_python_client==2.113.0
httplib2==0.22.0
matplotlib==3.8.2
oauth2client==4.1.3
Pillow==10.2.0
plexapi==4.15.7
psutil==5.9.7
python_twitter==3.5
Requests==2.31.0
urllib3==2.1.0