diff --git a/Dockerfile b/Dockerfile index 7d46508..8a47bb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,13 @@ FROM python:3-alpine AS base # Image to Build Dependencies FROM base AS builder - WORKDIR /app - COPY ./requirements.txt /app - # Build Dependencies -RUN apk update \ -&& apk add --virtual build-deps gcc python3-dev musl-dev \ -&& apk --no-cache add musl-dev libffi-dev openssl-dev libxml2-dev libxslt-dev file llvm-dev make g++ \ -&& apk add jpeg-dev zlib-dev libjpeg \ -&& pip install Pillow \ -&& apk del build-deps +RUN apk update +RUN apk add musl-dev musl-dev g++ gcc make python3-dev build-base +RUN apk add libffi-dev openssl-dev libxml2-dev libxslt-dev file llvm-dev +RUN apk add jpeg-dev zlib-dev libjpeg # Python Dependencies RUN pip install --no-cache-dir --prefix=/install gunicorn @@ -20,13 +15,11 @@ RUN pip install --no-cache-dir --prefix=/install -r requirements.txt # Runtime Environment Image FROM base - - WORKDIR /app + # Runtime Dependencies RUN apk --no-cache add libxml2 libxslt COPY --from=builder /install /usr/local COPY . /app/ - EXPOSE 1337 -CMD gunicorn kycnot:app --bind 0.0.0.0:1337 --worker-class sanic.worker.GunicornWorker +CMD gunicorn kycnot:app --bind 0.0.0.0:1337 --worker-class sanic.worker.GunicornWorker \ No newline at end of file diff --git a/kycnot.py b/kycnot.py index f04547f..2758381 100755 --- a/kycnot.py +++ b/kycnot.py @@ -13,7 +13,7 @@ from random import randrange import ruamel.yaml import datetime import os.path -import qrcode +#import qrcode import httpx import os import re @@ -62,7 +62,7 @@ async def about(request): r = httpx.get( "https://codeberg.org/schylza/schylza/raw/branch/main/SUPPORT.md") donations = yaml.load(r.content) - await generate_donations_qrcodes(donations) + #await generate_donations_qrcodes(donations) return html(template.render(date=date, title="KYC? Not me!", subtitle="About KYCNOT.ME", support=donations)) @@ -165,6 +165,7 @@ async def gns(request): return text('POST request - {}'.format(request.json)) return(html(template.render())) +''' async def generate_donations_qrcodes(donations): qr = qrcode.QRCode() qr.add_data(donations['xmr']) @@ -184,6 +185,7 @@ async def generate_donations_qrcodes(donations): xmr.save("static/img/qrcodes/xmr.png") btc.save("static/img/qrcodes/btc.png") nano.save("static/img/qrcodes/nano.png") +''' async def get_trustpilot_info(service): r = httpx.get( diff --git a/requirements.txt b/requirements.txt index fc9b8d9..c3e2c17 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,11 +17,8 @@ lazy-object-proxy==1.6.0 MarkupSafe==2.0.1 mccabe==0.6.1 multidict==5.1.0 -petname==2.6 -Pillow==8.3.2 pylint==2.8.3 PyYAML==5.4.1 -qrcode==7.3 rfc3986==1.5.0 ruamel.appconfig==0.5.5 ruamel.std.argparse==0.8.3