Updated docker-compose
This commit is contained in:
parent
8ef613b155
commit
0d38808e16
@ -1,11 +1,12 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
services:
|
services:
|
||||||
comicopds:
|
comicopds:
|
||||||
image: comicopds
|
image: .
|
||||||
container_name: comicopds
|
container_name: comicopds
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- '5000:5000'
|
- '5000:5000'
|
||||||
volumes:
|
volumes:
|
||||||
- '/opt/data/Comics/ComicRack:/library:ro'
|
#- '/opt/data/Comics/ComicRack:/library:ro'
|
||||||
|
- '~/ComicsTest/Comics:/library:ro'
|
||||||
- '${PWD}/:/app'
|
- '${PWD}/:/app'
|
||||||
|
15
main.py
15
main.py
@ -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 flask_httpauth import HTTPBasicAuth
|
||||||
from werkzeug.security import check_password_hash
|
from werkzeug.security import check_password_hash
|
||||||
from gevent.pywsgi import WSGIServer
|
from gevent.pywsgi import WSGIServer
|
||||||
@ -31,6 +31,14 @@ def verify_password(username, password):
|
|||||||
|
|
||||||
|
|
||||||
@app.route("/")
|
@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")
|
@app.route("/healthz")
|
||||||
def healthz():
|
def healthz():
|
||||||
return "ok"
|
return "ok"
|
||||||
@ -90,11 +98,12 @@ def send_content(path):
|
|||||||
@app.route("/catalog/<path:path>")
|
@app.route("/catalog/<path:path>")
|
||||||
@auth.login_required
|
@auth.login_required
|
||||||
def catalog(path=""):
|
def catalog(path=""):
|
||||||
|
#print("PRESSED ON")
|
||||||
start_time = timeit.default_timer()
|
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)
|
c = fromdir(request.root_url, request.url, config.CONTENT_BASE_DIR, path)
|
||||||
elapsed = timeit.default_timer() - start_time
|
elapsed = timeit.default_timer() - start_time
|
||||||
print(elapsed)
|
#print("RENDERED IN: " + str(elapsed))
|
||||||
|
|
||||||
return c.render()
|
return c.render()
|
||||||
|
|
||||||
|
18
test.json
18
test.json
@ -62,13 +62,25 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Aquaman": [
|
"number 1": [
|
||||||
{
|
{
|
||||||
"title": "",
|
"title": "",
|
||||||
"volume": "",
|
"volume": "",
|
||||||
"publisher": "",
|
"publisher": "",
|
||||||
"series": "aquaman",
|
"series": "",
|
||||||
"issue": ["2","3","5","10","22"]
|
"issue": ["1"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
,
|
||||||
|
{
|
||||||
|
"Aquaman": [
|
||||||
|
{
|
||||||
|
"title": ["Tyrant King", "The Deluge Act Three", "Warhead Part One"],
|
||||||
|
"volume": "",
|
||||||
|
"publisher": "",
|
||||||
|
"series": "",
|
||||||
|
"issue": ""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user