Updated docker-compose

This commit is contained in:
FrederikBaerentsen 2023-01-15 10:37:05 +01:00
parent 8ef613b155
commit 0d38808e16
3 changed files with 30 additions and 8 deletions

View File

@ -1,11 +1,12 @@
version: '3.3'
services:
comicopds:
image: comicopds
image: .
container_name: comicopds
restart: unless-stopped
ports:
- '5000:5000'
volumes:
- '/opt/data/Comics/ComicRack:/library:ro'
#- '/opt/data/Comics/ComicRack:/library:ro'
- '~/ComicsTest/Comics:/library:ro'
- '${PWD}/:/app'

15
main.py
View File

@ -1,4 +1,4 @@
from flask import Flask, send_from_directory, request
from flask import Flask, render_template, send_from_directory, request
from flask_httpauth import HTTPBasicAuth
from werkzeug.security import check_password_hash
from gevent.pywsgi import WSGIServer
@ -31,6 +31,14 @@ def verify_password(username, password):
@app.route("/")
def startpage():
conn = sqlite3.connect('app.db')
cursor = conn.cursor()
cursor.execute("select * from comics;")
result = cursor.fetchall()
conn.close()
return render_template("start.html", result=result)
@app.route("/healthz")
def healthz():
return "ok"
@ -90,11 +98,12 @@ def send_content(path):
@app.route("/catalog/<path:path>")
@auth.login_required
def catalog(path=""):
#print("PRESSED ON")
start_time = timeit.default_timer()
print(request.root_url)
#print(request.root_url)
c = fromdir(request.root_url, request.url, config.CONTENT_BASE_DIR, path)
elapsed = timeit.default_timer() - start_time
print(elapsed)
#print("RENDERED IN: " + str(elapsed))
return c.render()

View File

@ -62,13 +62,25 @@
]
},
{
"Aquaman": [
"number 1": [
{
"title": "",
"volume": "",
"publisher": "",
"series": "aquaman",
"issue": ["2","3","5","10","22"]
"series": "",
"issue": ["1"]
}
]
}
,
{
"Aquaman": [
{
"title": ["Tyrant King", "The Deluge Act Three", "Warhead Part One"],
"volume": "",
"publisher": "",
"series": "",
"issue": ""
}
]
}