diff --git a/.gitignore b/.gitignore index 85d3ab1..1ab73fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store build/ dist/ MANIFEST @@ -5,4 +6,4 @@ __pycache__/ src/__pycache__/ config.json env/ -.vscode/ +.vscode/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d9940d5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:latest + +WORKDIR "/root/Bulk Downloader for Reddit" +COPY ./requirements.txt ./ +RUN ["pip", "install", "-r", "requirements.txt"] +EXPOSE 8080 +EXPOSE 7634 + +CMD ["python", "script.py", "-d", "downloads"] \ No newline at end of file diff --git a/README.md b/README.md index 1a62506..35dfb18 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,13 @@ Install it through a package manager such as **Chocolatey** in Windows, **apt** OR, [Download ffmpeg](https://www.ffmpeg.org/download.html) manually on your system and [add the bin folder in the downloaded folder's directory to `PATH` of your system.](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/) However, package manager option is suggested. +## 🐋 Docker +There is also a complete ready to go Docker integration. Install **Docker** and **docker-compose**. Then run the following command from the repository root: +### `docker-compose run --service-ports bdfr` +And you'll find youself right in the app. The files will be downloaded to `downloads/`. Since it is docker, you may want to change the ownership of the files once you're done (belongs to root by default). + +_Credits to [wAuner](https://github.com/wAuner)_ + ## ⚙ Options Some of the below features are available only through command-line. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e9c069a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: "3" +services: + bdfr: + image: bdfr + build: . + ports: + - "8080:8080" + - "7634:7634" + volumes: + - "./:/root/Bulk Downloader for Reddit" + container_name: bdfr_container + network_mode: bridge \ No newline at end of file diff --git a/src/reddit.py b/src/reddit.py index 05b7bc9..c5cb864 100644 --- a/src/reddit.py +++ b/src/reddit.py @@ -51,7 +51,7 @@ class Reddit: """ server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - server.bind(('localhost', self.PORT)) + server.bind(('0.0.0.0', self.PORT)) server.listen(1) client = server.accept()[0] server.close()