Browse Source

Update dependencies, add Dockerfile and docker-compose.yml

Signed-off-by: vlnst <vlnst@bloat.cat>
vlnst 1 year ago
parent
commit
038f36c342
5 changed files with 27 additions and 2 deletions
  1. 10 0
      Dockerfile
  2. 2 1
      README.org
  3. 9 0
      docker-compose.yml
  4. 2 1
      main.py
  5. 4 0
      requirements.txt

+ 10 - 0
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" ]

+ 2 - 1
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

+ 9 - 0
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"

+ 2 - 1
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)

+ 4 - 0
requirements.txt

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