Docker integration

This commit is contained in:
Ali Parlakçı
2020-06-05 17:23:45 +03:00
committed by GitHub
parent a92ddb21f9
commit df7f5381a0
5 changed files with 31 additions and 2 deletions

3
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.DS_Store
build/
dist/
MANIFEST
@@ -5,4 +6,4 @@ __pycache__/
src/__pycache__/
config.json
env/
.vscode/
.vscode/

9
Dockerfile Normal file
View File

@@ -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"]

View File

@@ -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.

12
docker-compose.yml Normal file
View File

@@ -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

View File

@@ -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()