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

Adding Docker support #34

Open
wants to merge 7 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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
Vagrant/
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM python:3.4-slim-stretch

WORKDIR /tmp
COPY . .

RUN echo 'deb http://deb.debian.org/debian stretch main non-free' > /etc/apt/sources.list \
&& apt-get -q update \
&& BUILD_PACKAGES='wget build-essential libffi-dev libfdk-aac-dev automake autoconf' \
&& apt-get install -qy --force-yes $BUILD_PACKAGES lame flac faac libav-tools vorbis-tools opus-tools \
&& wget https://github.com/nu774/fdkaac/archive/v0.6.3.tar.gz \
&& tar xvf v0.6.3.tar.gz \
&& cd fdkaac-0.6.3 \
&& autoreconf -i \
&& ./configure \
&& make install \
&& cd .. \
&& ARCHIVE=libspotify-12.1.51-Linux-$(uname -m)-release \
&& wget -O ${ARCHIVE}.tar.gz https://github.com/mopidy/libspotify-archive/blob/master/${ARCHIVE}.tar.gz?raw=true \
&& tar xvf ${ARCHIVE}.tar.gz \
&& cd ${ARCHIVE}/ \
&& make install prefix=/usr/local \
&& cd .. \
&& python setup.py install \
&& apt-get remove --purge -qy --force-yes $BUILD_PACKAGES \
&& apt-get autoremove -qy --force-yes \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*

WORKDIR /data
VOLUME ["/data"]
ENTRYPOINT ["spotify-ripper"]
CMD ["--help"]
27 changes: 27 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,33 @@ Windows
Unfortunately, pyspotify seems to have an issue building on Windows (if someone can get this to work, please let me know). The best alternative is to run a linux distribution in a virtual machine. Basic instructions to install Ubuntu on Virtual Box can be found in the `wiki <https://github.com/hbashton-ripper/wiki/Windows>`__.


Docker
~~~~~~

It's also possible to build & run spotify-ripper as a Docker container.

To build the image:

.. code:: bash

$ docker build -t spotify-ripper:latest .

To run the image:

.. code:: bash

$ docker run -it --rm \
-v ~/Music:/data \
-v ~/.spotify-ripper:/root/.spotify-ripper \
spotify-ripper:latest \
-d /data spotify:track:52xaypL0Kjzk0ngwv3oBPR

In the above example:

- Ripped files will be stored in host machine's ``~/Music`` folder, mapped to container's ``/data`` folder

- Configuration & Spotify key will be read from ``~/.spotify-ripper``

Optional Encoding Formats
~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down