Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker deployment of tidal-dl-ng #341

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <container-image-name> .
```
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
Expand Down Expand Up @@ -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 <container-image-name>:latest <command>
```
This command will also create a Docker volume to store your ```settings.json``` as well as your ```token.json``` when connected to Tidal.
The ```<command>``` 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.
Expand Down