fixup! Rework my page and add info from listenbrainz
Docker Build and Push / build-and-push (push) Failing after 19s
Docker Build and Push / build-and-push (push) Failing after 19s
This commit is contained in:
@@ -15,6 +15,8 @@ WORKDIR /app
|
|||||||
COPY . .
|
COPY . .
|
||||||
COPY --from=sass /build/blueprints/ ./blueprints/
|
COPY --from=sass /build/blueprints/ ./blueprints/
|
||||||
|
|
||||||
|
RUN apt update && apt upgrade
|
||||||
|
RUN apt install libmagic1
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
ENV FLASK_ENV=production
|
ENV FLASK_ENV=production
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import magic
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from htmlmin import minify
|
from htmlmin import minify
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
@@ -53,7 +54,8 @@ def static(filename: str):
|
|||||||
|
|
||||||
@bp.route("/asset/mb/<mbid>")
|
@bp.route("/asset/mb/<mbid>")
|
||||||
def mb_cover(mbid):
|
def mb_cover(mbid):
|
||||||
r = make_response(get_image_front(mbid, "250"))
|
r = make_response(image := get_image_front(mbid, "250"))
|
||||||
|
r.headers['Content-Type'] = magic.from_buffer(image[:2048], mime=True)
|
||||||
r.headers['Cache-Control'] = 'public, max-age=86400'
|
r.headers['Cache-Control'] = 'public, max-age=86400'
|
||||||
r.headers['Expires'] = (datetime.now() + timedelta(days=1)) \
|
r.headers['Expires'] = (datetime.now() + timedelta(days=1)) \
|
||||||
.strftime('%a, %d %b %Y %H:%M:%S GMT')
|
.strftime('%a, %d %b %Y %H:%M:%S GMT')
|
||||||
|
|||||||
@@ -4,3 +4,4 @@ htmlmin2
|
|||||||
requests
|
requests
|
||||||
APScheduler
|
APScheduler
|
||||||
musicbrainzngs
|
musicbrainzngs
|
||||||
|
python-magic
|
||||||
|
|||||||
Reference in New Issue
Block a user