diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9305b0b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.idea/ +Vagrant/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a3959d1 --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/README.rst b/README.rst index 70718cb..e7d9cf5 100644 --- a/README.rst +++ b/README.rst @@ -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 `__. +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 ~~~~~~~~~~~~~~~~~~~~~~~~~