diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6adf3fd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +# Official python 3.12 container image +FROM python:3.12-slim-bookworm + +# Set the working directory in the container to /app +WORKDIR /app + +# Updating repos +RUN apt update + +# Installing installing ffmpeg for tidal-dl-ng +RUN apt install -y ffmpeg + +#Installing tidal-dl-ng from pip +RUN pip install --upgrade tidal-dl-ng + +# Creating a user appuser to group users +RUN useradd -m -u 1000 -g users appuser + +# Creating .config and msuci folders and getting ownership of appuser's home folder +RUN mkdir -p /home/appuser/.config/tidal_dl_ng/ +RUN mkdir -p /home/appuser/music +RUN chown appuser:users -R /home/appuser/ && chmod -R 755 /home/appuser/ + +# As appuser : +USER appuser + +# Configuring ffmpeg and deownload path +RUN tidal-dl-ng cfg path_binary_ffmpeg /usr/bin/ffmpeg +RUN tidal-dl-ng cfg download_base_path /home/appuser/music + +# Working directory is appuser's home +WORKDIR /home/appuser/ + +# Default command if none provided is bash shell +CMD ["/bin/bash"] diff --git a/README.md b/README.md index 12abd78..4646842 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,9 @@ If you like this projects and want to support it, feel free to buy me a coffee ## 💻 Installation / Upgrade + +### Using pip + **Requirements**: Python == 3.12 (other versions might work but are not tested!) ```bash @@ -50,8 +53,19 @@ pip install --upgrade tidal-dl-ng pip install --upgrade tidal-dl-ng[gui] ``` +### Using Docker +**Requirements**: Docker == 27.5.0 (other verions might work but are not tested!) +All you need is the ```Dockerfile``` file from this repository and be in the same directory as it. +To build the image using ```docker build``` command: +```bash +docker build -t . +``` +You can give any name you want to the container. + + ## ⌨️ Usage +### 🐍 Using pip You can use the command line (CLI) version to download media by URL: ```bash @@ -82,6 +96,19 @@ tidal-dl-ng gui If you like to have the GUI version only as a binary, have a look at the [release page](https://github.com/exislow/tidal-dl-ng/releases) and download the correct version for your platform. +### 🐋 Using the Docker image +Simply create a music folder to mount to the container you will create, then run : +```bash +docker run -v "/path/to/host/music/folder:/home/appuser/music" -v tidal-dl-volume:/home/appuser/.config/tidal_dl_ng/ -it :latest +``` +This command will also create a Docker volume to store your ```settings.json``` as well as your ```token.json``` when connected to Tidal. +The `````` is where you use tidal-dl-ng as described in the previous section when using pip. + +⚠️ The folder from the host that you map in the container must exist, if Docker creates it it might be owned by ```root``` and tidal-dl-ng **will not have the rights** to write in this folder ⚠️ + +💡 You can also run a bash shell if you want to tinker in the container. Nano and ffmpeg are installed and the ffmpeg path is preconfigured in the ```settings.json```. +Currently, the Docker image does not support the GUI version. + ## 🧁 Features - Download tracks, videos, albums, playlists, your favorites etc.