artyshko / smd

Spotify Music Downloader
MIT License
1.35k stars 238 forks source link

Dockerfile / Docker image #13

Open alexanderadam opened 5 years ago

alexanderadam commented 5 years ago

It would be nice to have setup & dependencies available via Docker.

aledv commented 5 years ago

I guess thath is necessary Flask for use this project with a container

alexanderadam commented 5 years ago

@aledv can you explain why should it require Flask? :thinking:

IMHO for the no change should be necessary (except from adding a Dockerfile of course). After the image is available it should be possible to run it with something like

$ docker run smd -s spotify:track:7ARveOiD31w2Nq0n5FsSf8 -v ./downloads:/downloads

instead of

$ ./main.py -s spotify:track:7ARveOiD31w2Nq0n5FsSf8
aledv commented 5 years ago

Ok, you have to run the container everytime... Whit flask you can leave the container always run and pass the parameters when you need a new request.

Sorry for my english

alexanderadam commented 5 years ago

I still don't see why flask is needed. A Docker process can be long and short running. Depending on what you need. If you need Docker for a server process, it will probably be a long running daemon and if you need just a short running CLI then it will just be a short running process.

This is why I don't think what you describes is related to Docker. Right now flask is IMHO not needed because smd is simply started when needed, right? Using smd via webinterface could be a feature for some people but I don't see why it should be related to Docker. Or do I miss something here?

prokopiff commented 4 years ago

I second this. The project has a lot of dependencies. I'm not a python developer and I don't know how to troubleshoot various python dependency issues. Dockerfile would ensure this works for anyone.

FROM python:3.8.0-buster

WORKDIR /app
RUN git clone https://github.com/artyshko/smd.git

WORKDIR /app/smd

RUN apt-get update
RUN apt-get install -y python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev   libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev
RUN pip3 install -r requirements.txt
RUN printf "import imageio\nimageio.plugins.ffmpeg.download()" > dl.py && python3 dl.py && rm dl.py
#RUN pip3 install PyQtWebEngine
#RUN apt-get install -y python3-pyqt5.qtwebengine 

CMD python3 main.py

If feel like this is close, but still it doesn't work. Can someone help?

miraclx commented 3 years ago

Check out freyr..https://github.com/miraclx/freyr-js

See #101