diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bb38e40 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3-alpine + +WORKDIR /usr/src/rural-dict + +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +CMD [ "python", "./main.py" ] diff --git a/README.org b/README.org index 587a8ce..af3ec7d 100644 --- a/README.org +++ b/README.org @@ -7,7 +7,7 @@ We're rural, not urban. A privacy respecting urban dictionary client, powered by | URL | Country | Ownername | Owner Website | |--------------------+---------+-----------+-----------------| | https://rd.vern.cc + [[http://rd.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion][Tor]] + [[http://vern5cxiaufqvhv4hu5ypkvw3tiwvuinae4evdbqzrioql6s2sha.b32.i2p][I2P]] | US | ~vern | https://vern.cc | -| https://rd.bloatcat.tk | IS | bloatcat | https://bloatcat.tk | +| https://rd.bloat.cat | RO | bloatcat | https://bloat.cat | * About Rural Dictionary scrapes urban dictionary for data and then displays it in html. @@ -27,6 +27,7 @@ Join our [[https://mto.vern.cc/#/#cobra-frontends:vern.cc][Matrix room]] for sup * Dependencies - bs4 - requests +- waitress - Relatively new version of python * Redirection diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..89fea3c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3" +services: + rural-dict: + build: + context: . + dockerfile: Dockerfile + restart: unless-stopped + ports: + - "127.0.0.1:8080:8080" diff --git a/main.py b/main.py index 7f7da95..5a99ab8 100644 --- a/main.py +++ b/main.py @@ -43,4 +43,5 @@ def catch_all(path): return render_template('index.html', data=scraped) if __name__ == '__main__': - app.run(port=8000) + from waitress import serve + serve(app, host="0.0.0.0", port=8080) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5e9a1a1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +beautifulsoup4 +requests +flask +waitress