Merge pull request 'Update dependencies, add Dockerfile and docker-compose.yml' (#5) from vlnst/rural-dict:main into main

Reviewed-on: #5
This commit is contained in:
Skylar "The Cobra" Widulski 2024-01-17 15:13:08 +00:00
commit 31c0a3aa28
5 changed files with 27 additions and 2 deletions

10
Dockerfile Normal file
View File

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

View File

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

9
docker-compose.yml Normal file
View File

@ -0,0 +1,9 @@
version: "3"
services:
rural-dict:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
ports:
- "127.0.0.1:8080:8080"

View File

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

4
requirements.txt Normal file
View File

@ -0,0 +1,4 @@
beautifulsoup4
requests
flask
waitress